Typeorm Decorators cause Module parse failed: Unexpected character '�'
Open
Nobody has claimed this yet.
bug
- Dominant language
- JavaScript
- Stars
- 9.8k
- Forks
- 326
- PR merge metrics
- No merged PRs in 30d
Description
Im trying to build a node typescript app, but it fails with the bellow output.
Seems like it fails in typeorm decorator.
ERROR in ./index 1:0
Module parse failed: Unexpected character '' (1:0)
File was processed with these loaders:
* ../../../../AppData/Roaming/npm/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js
You may need an additional loader to handle the result of these loaders.
(Source code omitted for this binary file)
@ ./node_modules/typeorm/decorator/Unique.js 3:14-33
@ ./node_modules/typeorm/index.js 54:21-50
@ ./src/entity/Camera.ts 13:18-36
@ ./src/resolvers/CameraResolver.ts 30:17-44
@ ./src/index.ts 40:25-62
running ncc as:
ncc build -w src/index.ts -o ./build
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing ncc build -w src/index.ts -o ./build and trace the loader failure from node_modules/typeorm/decorator/Unique.js through src/entity/Camera.ts. Compare the reported binary-file parse error with ncc's loader handling; done means the TypeScript app builds without the module parse failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100