RaphaelWoude / capacitor-native-settings

Capacitor plugin to open native settings screens for android and iOS
MIT License
95 stars 30 forks source link

Failed to parse source map from './' Error: ENOENT: no such file or directory #28

Closed SaroGFX closed 2 years ago

SaroGFX commented 2 years ago

The ionic serve compiler gives these warning/errors each time. The files are not in those locations. Any thoughts on how to fix this?

[react-scripts] WARNING in ./node_modules/capacitor-native-settings/dist/esm/definitions.js
[react-scripts] Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
[react-scripts] Failed to parse source map from '/Users/saroverhees/Documents/git/appv2/app-v2/node_modules/capacitor-native-settings/src/definitions.ts' file: Error: ENOENT: no such file or directory, open '/Users/saroverhees/Documents/git/appv2/app-v2/node_modules/capacitor-native-settings/src/definitions.ts'
[react-scripts] WARNING in ./node_modules/capacitor-native-settings/dist/esm/index.js
[react-scripts] Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
[react-scripts] Failed to parse source map from '/Users/saroverhees/Documents/git/appv2/app-v2/node_modules/capacitor-native-settings/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/saroverhees/Documents/git/appv2/app-v2/node_modules/capacitor-native-settings/src/index.ts'
[react-scripts] WARNING in ./node_modules/capacitor-native-settings/dist/esm/web.js
[react-scripts] Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
[react-scripts] Failed to parse source map from '/Users/saroverhees/Documents/git/appv2/app-v2/node_modules/capacitor-native-settings/src/web.ts' file: Error: ENOENT: no such file or directory, open '/Users/saroverhees/Documents/git/appv2/app-v2/node_modules/capacitor-native-settings/src/web.ts'

@capacitor/cli: 4.3.0 @capacitor/core: 4.3.0 @capacitor/android: 4.3.0 @capacitor/ios: 4.3.0

RaphaelWoude commented 2 years ago

Hello. I was not able to reproduce the same warnings u got with a fresh react project. Would you be able to provide me with a minimal reproduction project?

SaroGFX commented 2 years ago

Hi @RaphaelWoude , I tried to setup a reproduction repo but couldn't manage to reproduce it. I even duplicated the exact node_modules and configuration files in this new repo. And the issue still wasn't there. So I am completely stuck on what might cause this linting error.

It can be however disabled the messages by setting GENERATE_SOURCEMAP=false in .env

If you have any clue to what this could be related to in our codebase, then please let me know. I am eager to learn how this can be an issue in the node_modules but is seemingly unrelated to it.

RaphaelWoude commented 2 years ago

Would you be able to provide the versions of node & npm that you are currently using? Might have a feeling it has to do with the versions of node or npm.

SaroGFX commented 2 years ago
@Saros-MBP-2 source-map-error % node -v
v16.14.0
@Saros-MBP-2 source-map-error % npm -v
8.3.1

Thanks for the response. My friend is running 17.4 and 8.4 on a Linux, and is having the same errors :(

RaphaelWoude commented 2 years ago

I have released a potential fix for the source map warnings in v4.0.3. Now live on NPM. Please let me know if this fixes the issue.

SaroGFX commented 2 years ago

@RaphaelWoude This does seem to fix the issue, thanks a lot!