mikro-orm-graphql-example
mikro-orm-graphql-example copied to clipboard
Build and start don't work
The dev mode works well, however not the build process.
npm install
Install ok.
npm run build
Error:
src/utils/services/loadFixtures.service.ts:65:9 - error TS2740: Type 'Tag[]' is missing the following properties from type 'Collection<Tag, unknown>': snapshot, dirty, _populated, _lazyInitialized, and 42 more.
65 book.tags = [orm.em.getRepository(Tag).getReference(tags[bookIndex].id)];
~~~~~~~~~
I comment this line. Build ok.
npm run start
Error:
> cross-env NODE_PATH=./dist/src node dist/src/index.js
node_modules/globby/index.js:28
} catch {
^
SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (node_modules/@mikro-orm/core/cache/FileCacheAdapter.js:7:34)
works fine for me. However... upgrading to the latest, from "^4.0.0-rc.0" to "4.5.9" creates the issue reported above
@orefalo about the 1st error, it doesn't work for both versions.
it does for me, you must have something broken.
I will submit a pull request tomorrow
Here - https://github.com/orefalo/mikro-orm-graphql-example all working