Skip to content
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

browserify doesn't include typeahead when it does its stuff #25

Open
dcoli opened this issue Dec 16, 2016 · 0 comments
Open

browserify doesn't include typeahead when it does its stuff #25

dcoli opened this issue Dec 16, 2016 · 0 comments

Comments

@dcoli
Copy link

dcoli commented Dec 16, 2016

When I build my app for production, using enableProdMode() and this:
npm run build && browserify -s main app/main.js > app/bundle.js
On load I get:

Error: (SystemJS) Unexpected value 'Typeahead' declared by the module 'AppModule'

This doesn't happen when I build it without browserify. Not very familiar with browserify, but it seems to be pruning a dependency on Typeahead, which I actually need.

In systemjs.config.js, the map section (npm points to node_modules):
'ng2-typeahead': 'npm:ng2-typeahead',
In the packages section:
'ng2-typeahead': { main: './index', defaultExtension: 'js' }
In dependencies in package.json:
"ng2-typeahead": "^1.2.0",
At the top of app.module.ts:
import { Typeahead } from 'ng2-typeahead';
In the @NgModule:
declarations: [ AppComponent, ContentDisplayComponent, EllipsisPipe, Typeahead ],
And in the subcomponent that actually uses it (which is probably overkill):
import { Typeahead } from 'ng2-typeahead';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant