Skip to content

Conversation

@doramatadora
Copy link
Contributor

No description provided.

@JakeChampion
Copy link
Contributor

JakeChampion commented Feb 3, 2023

I tried to use this and got a funky error:

❯ gh repo clone https://github.com/fastly/compute-starter-kit-javascript-default
❯ cd compute-starter-kit-javascript-default/
❯ gh pr checkout https://github.com/fastly/compute-starter-kit-javascript-default/pull/36
Branch 'dora-fix-serve' set up to track remote branch 'dora-fix-serve' from 'origin'.
Switched to a new branch 'dora-fix-serve'
❯ ..
❯ md a
❯ fastly compute init --from ../compute-starter-kit-javascript-default -i
❯ fastly compute serve
✓ Initializing...
✓ Verifying package manifest...
✓ Verifying local javascript toolchain...
✓ Running [scripts.build]...
✓ Creating package archive...

SUCCESS: Built package (pkg/a.tar.gz)

✓ Checking latest Viceroy release...
✓ Checking installed Viceroy version...
✓ Running local server...

2023-02-03T16:35:22.775542Z ERROR failed to parse WebAssembly module
Error: Other(failed to parse WebAssembly module

Caused by:
    Invalid input WebAssembly code at offset 12197044: data count and data section have inconsistent lengths)

ERROR: error during execution process:

2023-02-03T16:35:22.775542Z ERROR failed to parse WebAssembly module
Error: Other(failed to parse WebAssembly module

Caused by:
    Invalid input WebAssembly code at offset 12197044: data count and data section have inconsistent lengths).

If you believe this error is the result of a bug, please file an issue: https://github.com/fastly/cli/issues/new?labels=bug&template=bug_report.md

@doramatadora doramatadora requested a review from a team as a code owner February 3, 2023 17:13
Copy link

@chrispoole643 chrispoole643 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works for me 😄

@JakeChampion
Copy link
Contributor

LGTM, could we update fastly.toml to have a scripts section which explicitly calls npm run build?
Currently it uses the default command entered by the fastly cli, which is this npm exec webpack && npm exec js-compute-runtime ./bin/index.js ./bin/main.wasm -- that is currently the same logic as npm run build but will become out of sync when a customer updates the contents of npm run build

@Integralist
Copy link
Contributor

👋🏻 @JakeChampion @doramatadora

re:

could we update fastly.toml to have a scripts section which explicitly calls npm run build?

Just wanted to give a heads-up that this could break expectations for users on an older CLI version (pre-4.0.0).

I'm still working internally to get the stats for CLI version usage so we can stop worrying about this and are free to add a build script to starter kits in future.

The summary of the issue is that pre v4 of the CLI it treated [scripts.build] as an optional setting and if it found one defined it would present a warning message to users telling them to be careful that a custom build script would be executed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants