ionic-team / ionic-storage

Ionic Storage module for Ionic apps
MIT License
438 stars 99 forks source link

bug: source maps not working as expected, warnings on react-scripts 5 #247

Open liamdebeasi opened 2 years ago

liamdebeasi commented 2 years ago

Ionic Team note: This is a continuation of https://github.com/ionic-team/ionic-framework/issues/24848.

Prerequisites

Ionic Framework Version

Current Behavior

Libraries (Ionic storage, Capacitor Radar, Capacitor Community Camera Preview) don't load correctly. For Ionic Storage, ionic serve gives an error:

[react-scripts] Failed to parse source map from 'C:\Users\USER\Desktop\FOLDER\ionic-6-testing\node_modules\@ionic\storage\src\index.ts' file: Error: ENOENT: no such file or directory, open 'C:\Users\USER\Desktop\FOLDER\ionic-6-testing\node_modules\@ionic\storage\src\index.ts'

Expected Behavior

In Ionic 5 the same process doesn't produce an error and the libraries work.

Steps to Reproduce

ionic start bug-testing blank --type=ionic-react
cd bug-testing
npm install @ionic/storage

Add the following line to Home.tsx:

import { Storage } from "@ionic/storage";
const store = new Storage();

Code Reproduction URL

https://github.com/villepaananen/ionic-6-enoent-error

Ionic Info

[WARN] Error loading @capacitor/ios package.json: Error: Cannot find module '@capacitor/ios/package'

       Require stack:
       - C:\Users\USER\AppData\Roaming\npm\node_modules\@ionic\cli\lib\project\index.js
       - C:\Users\USER\AppData\Roaming\npm\node_modules\@ionic\cli\lib\index.js
       - C:\Users\USER\AppData\Roaming\npm\node_modules\@ionic\cli\index.js
       - C:\Users\USER\AppData\Roaming\npm\node_modules\@ionic\cli\bin\ionic
[WARN] Error loading @capacitor/android package.json: Error: Cannot find module '@capacitor/android/package'

       Require stack:
       - C:\Users\USER\AppData\Roaming\npm\node_modules\@ionic\cli\lib\project\index.js
       - C:\Users\USER\AppData\Roaming\npm\node_modules\@ionic\cli\lib\index.js
       - C:\Users\USER\AppData\Roaming\npm\node_modules\@ionic\cli\index.js
       - C:\Users\USER\AppData\Roaming\npm\node_modules\@ionic\cli\bin\ionic

Ionic:

   Ionic CLI       : 6.18.1 (C:\Users\USER\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework : @ionic/react 6.0.9

Capacitor:

   Capacitor CLI      : 3.4.1
   @capacitor/android : not installed
   @capacitor/core    : 3.4.1
   @capacitor/ios     : not installed

Utility:

   cordova-res : 0.15.4
   native-run  : 1.5.0

System:

   NodeJS : v16.14.0 (C:\Program Files\nodejs\node.exe)
   npm    : 8.5.2
   OS     : Windows 10

Additional Information

No response

zac404 commented 2 years ago

Same problem here: [react-scripts] Failed to parse source map from '/Users/USER/FOLDER/node_modules/@ionic/storage/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/USER/FOLDER/node_modules/@ionic/storage/src/index.ts'

I am using: @ionic/react: 6.3.8, @ionic/storage: 3.0.6, MacOS 12.6

b3nk4n commented 1 year ago

Same problem here: [react-scripts] Failed to parse source map from '/Users/USER/FOLDER/node_modules/@ionic/storage/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/USER/FOLDER/node_modules/@ionic/storage/src/index.ts'

I am using: @ionic/react: ^6.0.0, @ionic/storage: 3.0.6, MacOS 13.0.1

olliescase commented 1 year ago

Same issue for me too -

[react-scripts] Failed to parse source map from '/Users/USER/FOLDER/node_modules/@ionic/storage/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/USER/FOLDER/node_modules/@ionic/storage/src/index.ts'
Software Version
Node v18.10.0
@ionic/core 6.4.2
@ionic/react 6.4.2
@ionic/storage 3.0.6
OS MacOS Ventura 13.1

Is there any updates to this issue? We're approaching the 1-year anniversary 😄

mattbatman commented 1 year ago

Same basic issue.

[react-scripts] Failed to parse source map from '/Users/user/project/node_modules/@ionic/storage/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/user/project/node_modules/@ionic/storage/src/index.ts'
Software Version
Node v18.15.0
@ionic/react ^6.0.0
@ionic/storage ^3.0.6
OS MacOS Ventura 13.2.1
@capacitor/android 4.7.1