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

getStaticProps + node builtins + dev server fails #132

Open
mxmul opened this issue Mar 6, 2021 · 1 comment
Open

getStaticProps + node builtins + dev server fails #132

mxmul opened this issue Mar 6, 2021 · 1 comment

Comments

@mxmul
Copy link

mxmul commented Mar 6, 2021

I've been trying to statically generate pages with getStaticProps and getStaticPaths, but the dev server crashes whenever I try to import fs; production builds work just fine.

 ❱ yarn start
yarn run v1.22.10
warning package.json: No license field
$ microsite
[snowpack] ! building dependencies...
~/snowpack/esinstall/lib/entrypoints.js:168
        throw new Error(`Package "${dep}" not found. Have you installed it? ${depManifestLoc ? depManifestLoc : ''}`);
              ^

Error: Package "fs" not found. Have you installed it?
    at Object.resolveEntrypoint (~/snowpack/esinstall/lib/entrypoints.js:168:15)
    at resolveWebDependency (~/snowpack/esinstall/lib/index.js:89:31)
    at Object.install (~/snowpack/esinstall/lib/index.js:203:36)
    at Object.run (~/snowpack/snowpack/lib/sources/local-install.js:43:43)
    at installDependencies (~/snowpack/snowpack/lib/sources/local.js:54:49)
    at async Object.prepare (~/snowpack/snowpack/lib/sources/local.js:109:35)
    at async startServer (~/snowpack/snowpack/lib/commands/dev.js:278:27)
    at async dev (file://~/microsite/examples/root/node_modules/microsite/dist/cli/microsite-dev.js:57:22)

I've tested this with the latest SHA of both microsite@1.1.0 and snowpack, and get the same result. You should be able to repro by running npm start in this example project: ./examples/root

@natemoo-re
Copy link
Owner

Just ran into some weirdness around builtins myself. I'm taking a look!

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

2 participants