build fails on 2.0.0
getting a failed sapper build after updating to 2.0.0 and installing deps with yarn --production --pure-lockfile
seems to not like the webpack.config.js having a different file extension?
pinafore@mastodon:/srv/pinafore$ yarn build
yarn run v1.22.5
$ cross-env NODE_ENV=production run-s build-steps
$ run-s before-build sapper-export build-vercel-json
$ run-p build-template-html build-assets build-webpack-config
$ node ./bin/build-template-html.js
$ node ./bin/build-assets.js
$ rollup -c ./webpack/rollup.config.js
./webpack/webpack.config.js → ./webpack/webpack.config.cjs...
created ./webpack/webpack.config.cjs in 61ms
./webpack/svelte-intl-loader.js → ./webpack/svelte-intl-loader.cjs...
created ./webpack/svelte-intl-loader.cjs in 48ms
Built template.html in 746.11ms
$ cross-env PORT=22939 WEBPACK_CONFIG_FILE=webpack/webpack.config.cjs SERVER_FILE_EXT=cjs node ./node_modules/sapper/sapper export
> Building...
> As of Sapper 0.21, build configuration should be placed in a single webpack.config.js file
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "sapper-export" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build-steps" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
pinafore@mastodon:/srv/pinafore$ node --version
v12.22.4
pinafore@mastodon:/srv/pinafore$ yarn --version
1.22.5
there's some more info here https://sapper.svelte.dev/migrating#0_20_to_0_21
Looks like you're not getting the fork of Sapper that changes the file extension. Try:
rm -fr node_modules
yarn install --force
If that doesn't work, check node_modules/sapper and see that it matches: https://github.com/nolanlawson/sapper/commits/for-pinafore-26
somehow it looks like sapper is getting 0.27.12 in package-lock.json. not sure how to force it to grab the right version
@benharri If you have a package-lock.json then you should delete it. This project uses yarn so it's best to run yarn instead of npm install.
I'm running into the same problem with my copy. As far as I can see, it doesn't fetch your version of sapper, though I couldn't say why.
Ah ok. Apparently when there is a version of sapper in the cache at ~/.cache/yarn/v6/npm-sapper-0.27.12, it will just copy over that one instead of fetching your fork.
Deleting that directory from the cache plus the node_modules directory and then rebuilding seems to solve the problem.
oh that would do it. worked fine after i cleared yarn's cache. a fix for this would be to bump @nolanlawson 's version on the sapper fork or to advise folks to clear the cache
Gotcha, I should bump the version in the fork. I'll reopen this to remind myself to do that.
I think I am coming up with the same or at least similar issues when doing a docker build