Module build failed (from ../../node_modules/@nrwl/web/src/utils/web-babel-loader.js)
See original GitHub issueCurrent Behavior
Babel is not compiling TS. I get the following error when trying to run npx nx serve app
:
ERROR in ../event-emitter/src/lib/event-emitter.ts
Module build failed (from ../../node_modules/@nrwl/web/src/utils/web-babel-loader.js):
SyntaxError: /Users/andy/dev/nx-test/packages/event-emitter/src/lib/event-emitter.ts: Unexpected token, expected "(" (6:34)
4 | * Create an event emitter.
5 | */
> 6 | export function createEventEmitter<
| ^
7 | T extends Record<string, unknown>
8 | >(): EventEmitter<T> {
Expected Behavior
TS syntax should be recognised correctly.
Steps to Reproduce
Here is a minimal repository: https://github.com/andyjessop/nx-test
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
Ask Question
main.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-preset-es2015' from ...
Read more >Bug Report
Bug Report Current Behavior when i try to run the command npm start i get that error : ERROR in ./main.js Module build...
Read more >Angular
Error : Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): · delete the node_modules folder · delete package-lock.json ...
Read more >Get Help and Help Others
Compiled with problems:X ERROR in ./src/components/Button/Button.tsx Module build failed (from ../node_modules/babel-loader/lib/index.js):.
Read more >Sign in - YouTube
Module build failed (from ./node_modules/source-map-loader/dist/cjs. js ): Error: ENOENT: no such file or directory, ...
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 Free
Top 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
I just added a
.babelrc
into each of my package root directories with these contents:This issue has been automatically marked as stale because it hasn’t had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏