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

Cannot import from node_modules in a Vue 2.4.1 project #25

Open
LeoLeal opened this issue Jul 14, 2017 · 4 comments
Open

Cannot import from node_modules in a Vue 2.4.1 project #25

LeoLeal opened this issue Jul 14, 2017 · 4 comments

Comments

@LeoLeal
Copy link

LeoLeal commented Jul 14, 2017

After installing your module using npm, i tried to import It like the example page says, and gulp throws error:

'import' and 'export' may appear only with 'sourceType: module'

It seems your module is malformed. I had to copy the MaskedInput.js code into my project and install Its dependency to make It work properly, but It looses the link to your npm project.

Using babelify + browserify + vueify combo with Vuejs 2.4.1

If you have any questions about this problem, lemme know. I'll gladly to help.

@MordiSacks
Copy link

I Have the same issue

developeruz added a commit to developeruz/vue-masked-input that referenced this issue Aug 9, 2017
Fix for getting error  "'import' and 'export' may appear only with 'sourceType: module'"
@amandamcg
Copy link

amandamcg commented Sep 27, 2017

I have the same issue

error: Processing of node_modules/vue-masked-input/dist/maskedInput.js failed. SyntaxError: 'import' and 'export' may only appear at the top level (5:4)

@cheesytim
Copy link

And I have the same issue

artemv added a commit to artemv/vue-masked-input that referenced this issue Jul 4, 2018
Es2015 preset is deprecated now: https://babeljs.io/docs/en/env.html.
This also switches off {modules: false} babelrc option which makes the
bundle compatible with Jest and some other env configurations.

Fixes niksmr#52
Fixes niksmr#25
@QoreCode
Copy link

You can try to declare this module. In some file in project need to write
declare module 'vue-masked-input';

I use ts and it's works for me

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

5 participants