UniversalRouter not working on docker release build
See original GitHub issueHi everyone,
I’m having an issue making the new version of UniversalRouter implementation working with a docker build on release…
The issue is the following one :
/app/build/webpack:/src/core/router.js:13
const router = new Router(routes)
^
TypeError: __WEBPACK_IMPORTED_MODULE_0_universal_router___default.a is not a constructor
at Object.<anonymous> (/app/build/webpack:/src/core/router.js:13:16)
at __webpack_require__ (/app/build/webpack:/webpack/bootstrap 2017df5206f6ff8da90a:19:1)
at Object.<anonymous> (/app/build/server.js:1335:72)
at __webpack_require__ (/app/build/webpack:/webpack/bootstrap 2017df5206f6ff8da90a:19:1)
at Object.<anonymous> (/app/build/server.js:9733:18)
at __webpack_require__ (/app/build/webpack:/webpack/bootstrap 2017df5206f6ff8da90a:19:1)
at /app/build/webpack:/webpack/bootstrap 2017df5206f6ff8da90a:65:1
at Object.<anonymous> (/app/build/server.js:71:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
error Command failed with exit code 1.
It works completely fine in development and when building it with the same command found in my docker-compose.yml
which is yarn run build -- --release --docker && node build/server.js
but it makes the container to exit on my server…
I’m requiring my routes the same way the boilerplate does and I’m on the branch feature/react-intl
(merged with Apollo client) just so you know.
If you new some code I’ll post it right away. Meanwhile I’ll try fixing this… 😅
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Issue with Angular Universal Docker build - Stack Overflow
I'm not sure if this is still relevant.. but you can try replacing your dockerfile with the following: ### Stage: 1 ### FROM...
Read more >Docker container crash while performing an "npm install ...
I have setup a docker container using a debian:latest image and installed node v 5.10.1 and npm 3 in it.
Read more >Top 5 universal-router Code Examples | Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >Make slim Rails Docker images - DEV Community
We have a two-step building process starting from a ruby:alpine image. First stage. In the first stage, size is not of utmost importance:...
Read more >Micro Frontends - extending the microservice idea to frontend ...
Techniques, strategies and recipes for building a modern web app with multiple teams ... there are still a few implementation problems in some...
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
Fixed for me with:
Is this error for client-side or server-side build? React Starter Kit version? Node.js version? Universal Router version? Have you tried this update? https://github.com/kriasoft/react-starter-kit/pull/1403 Also you can try to import this way: