Impossible to build/run a production build
See original GitHub issueHow to reproduce
keystone build
keystone start
Expected behavior
The app is built into a production-ready output dir (ex : dist
) and keystone start
runs that build.
Actual behavior
keystone build
does not appear to output any content that keystone dev
does not.
$ keystone build
β¨ Building Keystone
β¨ Generating Admin UI code
β¨ Generating Keystone config code
β¨ Building Admin UI
info - Skipping validation of types
info - Creating an optimized production build
info - Compiled successfully
info - Collecting page data
info - Generating static pages (18/18)
info - Finalizing page optimization
Page Size First Load JS
β β / 1.74 kB 444 kB
β /_app 0 B 442 kB
β β /404 194 B 442 kB
β Ξ» /api/__keystone_api_build 0 B 442 kB
β β /deliveries 257 B 451 kB
β β /deliveries/[id] 3.72 kB 446 kB
β β /environments 257 B 451 kB
β β /environments/[id] 3.72 kB 446 kB
β β /init 6.17 kB 448 kB
β β /licenses 253 B 451 kB
β β /licenses/[id] 3.72 kB 446 kB
β β /no-access 425 B 443 kB
β β /organizations 256 B 451 kB
β β /organizations/[id] 3.72 kB 446 kB
β β /projects 255 B 451 kB
β β /projects/[id] 3.72 kB 446 kB
β β /signin 1.6 kB 444 kB
β β /users 251 B 451 kB
β β /users/[id] 3.72 kB 446 kB
+ First Load JS shared by all 442 kB
β chunks/framework-b6621d06fb4f3aa0.js 42 kB
β chunks/main-8f3915d3027d012d.js 26.9 kB
β chunks/pages/_app-9ae8491b0b0789f0.js 373 kB
β chunks/webpack-5752944655d749a0.js 840 B
Ξ» (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
β (Static) automatically rendered as static HTML (uses no initial props)
Done in 17.24s.
Plus keystone start
fails anyway:
β¨ Starting Keystone
ReferenceError: Cannot access '__WEBPACK_DEFAULT_EXPORT__' before initialization
at Object.Z (/app/.keystone/admin/.next/server/pages/api/__keystone_api_build.js:199:36)
at Module.config (/app/.keystone/admin/.next/server/pages/api/__keystone_api_build.js:49:100)
at Object.start (/app/node_modules/@keystone-6/core/scripts/dist/keystone-6-core-scripts.cjs.dev.js:464:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Environment
NodeJS version 16
"dependencies": {
"@keystone-6/auth": "^1.0.2",
"@keystone-6/core": "^1.0.1",
"@keystone-6/fields-document": "^1.0.1",
"typescript": "^4.5.4",
}
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:13 (4 by maintainers)
Top Results From Across the Web
React production build failed to load - Stack Overflow
I have built some code with React. During its "development build", npm start at localhost:3000 give me the correct behavior.
Read more >Building for Production - Vite
When it is time to deploy your app for production, simply run the vite build command. By default, it uses <root>/index.html as the...
Read more >10 best practices to containerize Node.js web applications ...
The following article provides production-grade guidelines for building optimized and secure Node.js Docker images.
Read more >Multi-stage builds - Docker Documentation
$ docker build -t alexellis2/href-counter:latest . The end result is the same tiny production image as before, with a significant reduction in complexity....
Read more >Troubleshooting build errors and crashes - Expo Documentation
If your native toolchains are installed correctly and you are unable to build and run your project in release mode on your local...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
(I deleted a duplicate comment) This is interesting to follow along @JMLX42! Please keep us updated, as soon as you have a reproduction we can try and action this.
The same error finally popped again after editing nothing but
auth.js
to setprocess.env.SESSION_SECURE == "true"
.So if there is any circular dependency issue, it is most likely not in my code.
I think the problem is trying to build/run a production build with
NODE_ENV
not actually set to"production"
.