Repository navigation
Closed
Labels
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
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
Metadata
Metadata
Assignees
Labels
Type
Fields
No fields configured for issues without a type.
Activity
[-]bug: [/-][+]bug: ENOENT-bug with libraries on Ionic 6 [/+]liamdebeasi commentedon Feb 25, 2022
Thanks! I am going to move this to the @ionic/storage repository.
The problem here is that Ionic React 6 uses
react-scripts@5. This new version of react-scripts has sourcemap parsing enabled and will log a warning when no sourcemaps are found for a library. This did not happen in Ionic React 5 as that version requiredreact-scripts@4which did not have sourcemap parsing.Since this is a warning, it should not impact your ability to build/compile applications. I get the following warning on build, but the build completes successfully:
liamdebeasi commentedon Feb 25, 2022
I can't seem to transfer the issue at the moment, so I am going to close this in favor of ionic-team/ionic-storage#247. Please follow that thread for updates on this issue. Thanks!
ionitron-bot commentedon Mar 27, 2022
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.