Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build sample based on template #300

Open
radu-matei opened this issue Dec 10, 2024 · 5 comments
Open

Failed to build sample based on template #300

radu-matei opened this issue Dec 10, 2024 · 5 comments

Comments

@radu-matei
Copy link
Member

$ spin build
Building component demo with `npm run build`

> [email protected] build
> npx webpack --mode=production && npx mkdirp target && npx j2w -i dist.js -d combined-wit -n combined -o target/neutrino-ts-demo.wasm

(node:42708) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
asset dist.js 6 KiB [emitted] [javascript module] (name: main)
orphan modules 25.4 KiB [orphan] 25 modules
./src/spin.ts + 2 modules 5.97 KiB [built] [code generated]
webpack 5.97.1 compiled successfully in 573 ms
(node:42751) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:42791) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
node:internal/modules/esm/resolve:275
    throw new ERR_MODULE_NOT_FOUND(
          ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/radu/projects/src/github.com/misc/neutrino-ts-demo/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs' imported from /Users/radu/projects/src/github.com/misc/neutrino-ts-demo/node_modules/@jridgewell/source-map/dist/source-map.mjs
    at finalizeResolution (node:internal/modules/esm/resolve:275:11)
    at moduleResolve (node:internal/modules/esm/resolve:932:10)
    at defaultResolve (node:internal/modules/esm/resolve:1056:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:650:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:599:25)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:582:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:241:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:132:49) {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///Users/radu/projects/src/github.com/misc/neutrino-ts-demo/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs'
}

Node.js v23.1.0
Error: Build command for component neutrino-ts-demo failed with status Exited(1)
@karthik2804
Copy link
Collaborator

@radu-matei I assume this is not just the stock template and there is some package dependency. can you share the package.json which would be useful to investigate further.

@radu-matei
Copy link
Member Author

That is the stock template.

@karthik2804
Copy link
Collaborator

karthik2804 commented Dec 10, 2024

I am unable to reproduce this. I just installed spin 3.0 and updated templates using spin templates install --update --git https://github.com/fermyon/spin-js-sdk and creating a new app followed by

npm install
spin build

@mikkelhegn
Copy link
Member

Is this related to this issue in the modules repo? jridgewell/source-map#9 (It's from the same date). From reading that issue, I'm not sure how it's resolved? @radu-matei can you check?

@mikkelhegn
Copy link
Member

Ahh - looks like this is the issues, which should e resolved: jridgewell/gen-mapping#14

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

No branches or pull requests

3 participants