mikro-orm-graphql-example icon indicating copy to clipboard operation
mikro-orm-graphql-example copied to clipboard

Build and start don't work

Open vincentwinkel opened this issue 2 years ago • 5 comments

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)

vincentwinkel avatar Oct 11 '21 08:10 vincentwinkel

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 avatar Oct 11 '21 18:10 orefalo

@orefalo about the 1st error, it doesn't work for both versions.

vincentwinkel avatar Oct 16 '21 12:10 vincentwinkel

it does for me, you must have something broken.

orefalo avatar Oct 17 '21 17:10 orefalo

I will submit a pull request tomorrow

orefalo avatar Oct 17 '21 18:10 orefalo

Here - https://github.com/orefalo/mikro-orm-graphql-example all working

orefalo avatar Oct 18 '21 04:10 orefalo