-
Notifications
You must be signed in to change notification settings - Fork 18
Import of Module does not work in IONIC 3 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@mburger81 It doesn't go in the component. Import it into your app.module.ts. You'll then be able to use it anywhere within the app.module, which is most likely your entire app. app.module:
closing this issue. Let me know if this doesn't fix it. |
Yes, but it has still the same result
I'm using it in an Ionic3 app which is still angular4 and which should not be a problem. Looking to the installed node folder the |
well. that is true, there is no .js file. it's .ts. Honestly, I haven't considered supporting this in ionic, but I'm building an ionic app to test as we speak. I have a feeling there is a configuration issue with ts/js. What command are you running to get the error? Just |
Yes |
@mburger81 ... Got it to work using these steps:
I have it working locally. Your issue I think is the tsconfig, but that did expose a misnamed export in this repo. I hope this helps man. |
I'm getting the same error trying to use this package in an Ionic 3 app.
Currently using Angular 4.1.3, as that is the default Angular version shipping with the Ionic CLI. The The app is set up to use lazy loading so each component has it's own module with dependencies, but I've attempted both methods; loading the Ng4Fittext module in each components module and also loading it in the |
I left out a step above, I installed "sw-toolbox": "^3.6.0",. You guys are giving me a run for my money today. @TheBrockEllis , when researching your error, I actually found a thread that I had used for the same error recently check it out. Appears to be a (known) angular issue. |
Hi there, @sollenne! Thanks so much for the quick reply! I've been bashing my head against this issue for 4+ hours now. Made a little progress. Here is the current error that I am seeing:
I've tried adding the I already owe you a beer for your help, but have you seen anything like this before? I'm just about at my whits-end. |
So, I cloned the project and used angular cli and ng-packager to create an angular4 library as described by angular.
at the end now you can import the Module into any module you like, you don't have to import it into app module and you can import it only with the npm package name Now anything is working fine. At the end I got on production build the error mentioned firstly from @TheBrockEllis, this is an angular core problem, I downgraded it to 4.1.3 and anything is working great! Very great library!!! @sollenne If you like I can do a pullrequest? I have also done a enhancement on the lib, something we needed for us. |
@mburger81 @TheBrockEllis Are you guys working on the same project? @mburger81 Go ahead and make PR and I'll review it. If you want to include documentation for ionic 3 that would probably be helpful. @TheBrockEllis , If @mburger81's fix didn't work, can you open a new issue instead of using this thread? EDIT: this fix is quite involved. You can wait until the PR is merged if you like. I'll work on it now. |
We would like to test this lib and after installing it from npm we tried to import it on a component like this
import { Ng4FittextModule } from "ng4-fittext/ng4-fittext";
But with this we run in this error
Module build failed: Error: ENOENT: no such file or directory, open '/......./node_modules/ng4-fittext/ng4-fittext.js
I'm not an expert on angular/npm builds but I think you do something wrong on it can you provide a solution?
The text was updated successfully, but these errors were encountered: