kadoshms / ionic2-autocomplete

Ionic 2 autocomplete component
MIT License
149 stars 108 forks source link

Build for production (--prod) fails #136

Closed dzamula closed 6 years ago

dzamula commented 6 years ago

The command ionic build --prod fails with an error after updating from 1.5.4-alpha to 1.6.1-alpha:

_Error: ./node_modules/ionic2-auto-complete/dist/ionic2-auto-complete.ngfactory.js Module not found: Error: Can't resolve 'ionic2-auto-complete' in 'project_path/node_modules/ionic2-auto-complete/dist' resolve 'ionic2-auto-complete' in 'project_path/node_modules/ionic2-auto-complete/dist' Parsed request is a module using description file: project_path/nodemodules/ionic2-auto-complete/dist/package.json (relative path: .) Field 'browser' doesn't contain a valid alias configuration

dzamula commented 6 years ago

The workaround is to change the imports from

import {AutoCompleteService} from "ionic2-auto-complete/dist

to

import {AutoCompleteService} from "ionic2-auto-complete/src

but with "/src" the regular ionic serve is getting failing.

kadoshms commented 6 years ago

@dzamula Sorry about that! I published the whole source instead of the compiled one by mistake, please use 1.6.2-alpha instead.

P.S I added a publish script to avoid this from happening again.