You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 1, 2020. It is now read-only.
If I add a 3rd party module to my project and create a ./src/declarations.d.ts file definition for that module, I am able to run my app (if the definitions are correct) however the app-scripts output indicates error.
The error from the output that is meaningful is this: [01:41:57] src/pages/home/home.ts(5,18): error TS2307: Cannot find module 'node-uuid'.
$ ionic serve
Running 'serve:before' npm script before serve
> ionic-hello-world@ watch /Users/dan/Dev/lib-test
> ionic-app-scripts watch
[01:41:55] watch started ...
[01:41:55] build dev started ...
[01:41:55] clean started ...
[01:41:55] clean finished in 1 ms
[01:41:55] copy started ...
[01:41:55] typescript compiler started ...
[01:41:55] lint started ...
[01:41:55] copy finished in 38 ms
[01:41:56] lint finished in 440 ms
[01:41:57] src/pages/home/home.ts(5,18): error TS2307: Cannot find module 'node-uuid'.
[01:41:57] typescript compiler ready in 1.92 s
[01:41:57] bundle dev started ...
[01:42:00] rollup: Treating 'crypto' as external dependency
[01:42:01] rollup: No name was provided for external module 'crypto' in options.globals – guessing 'crypto'
[01:42:02] bundle dev finished in 5.11 s
[01:42:02] sass started ...
[01:42:03] sass finished in 912 ms
[01:42:03] build dev finished in 7.94 s
[01:42:03] watch ready in 8.00 s
The output indicates error, but the app still runs which indicates the error was not legitimate. The 3rd party module works as expected in the Ionic app within the browser. To verify, open the console and view a guid being logged.
Thanks,
Dan
The text was updated successfully, but these errors were encountered:
It is worth noting that the behavior gets worse after saving a file during an ionic serve session when a rebuild occurs.
After recreating the scenario above, make a change to ./src/pages/home.ts to trigger a rebuild.
You will see output that looks like this:
[01:46:29] src/pages/home/home.ts(5,18): error TS2307: Cannot find module 'node-uuid'.
[01:46:29] typescript compilation finished in 1.10 s
[01:46:29] bundle dev update started ...
[01:46:30] bundle dev update failed: Error: Could not load crypto (imported by /Users/dan/Dev/lib-test/node_modules/node-uuid/uuid.js): ENOENT: no such file or directory, open 'crypto'
[01:46:30] sass started ...
[01:46:30] sass finished in 5 ms
The output indicates correctly that the bundle fails to build, and the page does not refresh.
[01:46:30] bundle dev update failed: Error: Could not load crypto (imported by /Users/dan/Dev/lib-test/node_modules/node-uuid/uuid.js): ENOENT: no such file or directory, open 'crypto'
If I add a 3rd party module to my project and create a
./src/declarations.d.ts
file definition for that module, I am able to run my app (if the definitions are correct) however the app-scripts output indicates error.The error from the output that is meaningful is this:
[01:41:57] src/pages/home/home.ts(5,18): error TS2307: Cannot find module 'node-uuid'.
Steps to reproduce:
The output indicates error, but the app still runs which indicates the error was not legitimate. The 3rd party module works as expected in the Ionic app within the browser. To verify, open the console and view a
guid
being logged.Thanks,
Dan
The text was updated successfully, but these errors were encountered: