vkolgi / json-to-graphql-query

Simple module that converts JavaScript objects to GraphQL query syntax
MIT License
283 stars 39 forks source link

Strange Warning in Angular: "Cannot find source file" #26

Closed thorek closed 1 year ago

thorek commented 3 years ago
WARNING in ./node_modules/json-to-graphql-query/lib/types/EnumType.js
Module Warning (from ./node_modules/source-map-loader/index.js):
(Emitted value instead of an instance of Error) Cannot find source file '../../src/types/EnumType.ts': Error: Can't resolve '../../src/types/EnumType.ts' in '/Projects/activeql.d/activeql/angular/node_modules/json-to-graphql-query/lib/types'

Everything seems to work, I still like to figure out what's causes the warning, though. Any idea?

thorek commented 3 years ago

It's simply because the src folder is missing in your package. Can you include it?

dupski commented 3 years ago

I guess it'll just be a case of removing "src" from the npmignore file.

I'm not using a lot of node / typescript at the moment - does anyone know if it's common these days to include the original TS source along with the compiled versions in the NPM package? Seems a bit pointless if the definitions (d.ts) files are shipped, which is why this library currently doesn't...

thorek commented 3 years ago

Well, it does no harm. And file size shouldn’t be a problem in this case. So I suggest include it in the package. Otherwise the sourcemap should not point to src, since this results in the warning messages.

Great job btw!

thorek commented 3 years ago

It would be really great if you either remove it from the sourcemap or include the src - otherwise there are always very annoying warning messages every time the application started. It would be really really appreciated.

thorek commented 1 year ago

👍