-
Notifications
You must be signed in to change notification settings - Fork 302
Libs not found in prod mode #632
Comments
me too |
Same issue with me also |
Having the same issue with RC5 |
Same thing here. |
Check for case sensitive imports! See if the folder and component name in your imports are matching exactly with the actual folder name and component name. Eg. login == login and Login != login |
@severus1990, that's definitely not case related. All libs that I'm trying to import are lowercase, they're just outside of node_modules or src. |
Any news on this issue? |
Can someone create a minimal reproduction repo and share it here? I have not seen this issue. Thanks, |
Hey @danbucholtz, here's a repo with problem displayed: https://github.com/themastersoda/-ionic-app-scripts-632 external library sits in ./api folder. Everything works with |
Thanks for the repo. Where are you importing What is transpiling the code to javascript? It is outside of the TypeScript source path. Thanks, |
@danbucholtz, sorry, forgot to mention that. Import is in the home component. |
@danbucholtz another worthy mention is that with 0.0.45 the build process generated js, map and metadata files for this lib, so it seems that it was getting transpiled just fine during ngc. |
I will take a look. Thanks, |
Same thing here, any update? while using https://www.npmjs.com/package/angular2-tag-input . |
This is user error. If you want to reference a TypeScript file outside of the context of the src directory, you need to include it in the
It's working fine for me with Thanks, |
Thanks @danbucholtz , It worked. Any settings for modules inside node_module directory. |
@danbucholtz I'm curious why this problem manifests when building/running with the |
I'm not sure I'm following what you're asking. Thanks, |
@danbucholtz I am curious why when I or others (above) build or run the app in dev mode everything works correctly, but when the I had files that were "excluded" in my tsconfig because I didn't want them to be compiled on their own. They were imported from other .ts files that were included in the compilation process. This caused no problems when building/running in dev mode. When I switched over to prod mode these files were no longer accessible and caused errors to be generated (and surfaced at run-time). Any idea what the behaviour changes between dev & prod? |
@goleary Prod mode performs ahead of time compilation, so it has to be able to reach all source files used in your app. Since not all of them are available, compilation fails. Dev mode does not perform compilation, it just uses the existing files instead. |
Off the top of my head, I'm not sure. We assemble a list of typescript files and transpile them for dev mode, and then for prod mode we delegate that to Thanks, |
@themastersoda @danbucholtz cool thanks for the info! |
@danbucholtz , Error: The Angular AoT build failed. See the issues above //////////////////////////// my package.son "dependencies": { ////////////////////// my tsconfig ], "compileOnSave": false, |
Short description of the problem:
I have one Angular2 project created with the ng-cli and one Ionic2 project.
The angular2 project, called
core
is a library that I intend to reuse in many Angular2/Ionic2 projects.core
exports a NgModule, Services and all kind of sweets.My Ionic2 project has
core
as a NPM dependency and it can use/extend the classes contained incore
as long as I import them :import { CoreModule } from 'core';
for example.The content of
myionic/node_modules/core
is as follows:In
package.json
I have"main": "./dist/index.js
andindex.js
exports all my classes like so :export * from './src/core.module'
;In development mode (i.e.
ionic serve|run|emulate
) everything work as expected. In production mode, however, the minification breaks my import with the following error:Error: Module build failed: Error: ENOENT: no such file or directory, open '/Users/math/myionic/node_modules/core/src/core.module.js'
The
build
folder only contains one big js and nonode_modules
folder; which is kind of the point of minification.What behavior are you expecting?
Steps to reproduce:
Which @ionic/app-scripts version are you using?
2-rc4/1.0.0
The text was updated successfully, but these errors were encountered: