vue-bulma / collapse

Collapse component for Vue Bulma
MIT License
23 stars 13 forks source link

Unexpected token import #3

Open xereda opened 7 years ago

xereda commented 7 years ago

In VueJS 2.0, the following error occurred:

index.js?11f0:1 Uncaught SyntaxError: Unexpected token import

I wait for a return. Tks.

fundon commented 7 years ago

Do you use webpack?

xereda commented 7 years ago

Yeah.

xereda commented 7 years ago

Yeah

Em ter, 25 de out de 2016 às 12:15, Fangdun Cai notifications@github.com escreveu:

Do you use webpack?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vue-bulma/collapse/issues/3#issuecomment-256047051, or mute the thread https://github.com/notifications/unsubscribe-auth/ANrHOqsB6rg09gROacLuHhu4_mgiRD7Vks5q3g8GgaJpZM4Kf1j3 .

gary149 commented 7 years ago

@xereda It's because this repo is not ready for production. It does not provide a dist folder with the bundled files. You have the raw files and need to use webpack loaders (babel, .vue, etc...) to build a valid js bundle. That's why it fail on line 1:1 in chrome 'import'... is not valid js

xereda commented 7 years ago

OK.

I am individually importing the component files (.vue files / Collapse.vue and Item.vue). Do you see any problem with that?

fundon commented 7 years ago

@xereda See https://github.com/fundon/vue-admin/blob/master/build/webpack.base.conf.js#L60-L65, Maybe it helps you.

xereda commented 7 years ago

An error has occurred. Analyze this:

xereda@macminixereda:~/S/d/docmob.portal.vuejs2.0:master$ npm run dev

docmob.portal.vuejs2.0@1.0.0 dev /Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0 node build/dev-server.js

Listening at http://localhost:8080

/Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/webpack-core/lib/LoadersList.js:58 if(element.loader) return element.loader.split("!"); ^

TypeError: element.loader.split is not a function at getLoadersFromObject (/Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/webpack-core/lib/LoadersList.js:58:43) at LoadersList. (/Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/webpack-core/lib/LoadersList.js:78:12) at Array.map (native) at LoadersList.match (/Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/webpack-core/lib/LoadersList.js:70:19) at /Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/webpack/lib/NormalModuleFactory.js:111:68 at /Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/async/lib/async.js:726:13 at /Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/async/lib/async.js:52:16 at done (/Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/async/lib/async.js:246:17) at /Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/async/lib/async.js:44:16 at /Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/async/lib/async.js:723:17 at /Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/async/lib/async.js:167:37 at /Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:29:4 at onResolved (/Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/enhanced-resolve/lib/Resolver.js:39:10) at /Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/enhanced-resolve/lib/Resolver.js:123:21 at /Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/enhanced-resolve/lib/Resolver.js:191:15 at applyPluginsParallelBailResult.createInnerCallback.log (/Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/node_modules/enhanced-resolve/lib/Resolver.js:104:30)

npm ERR! Darwin 15.6.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev" npm ERR! node v6.8.0 npm ERR! npm v3.10.8 npm ERR! code ELIFECYCLE npm ERR! docmob.portal.vuejs2.0@1.0.0 dev: node build/dev-server.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the docmob.portal.vuejs2.0@1.0.0 dev script 'node build/dev-server.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the docmob.portal.vuejs2.0 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node build/dev-server.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs docmob.portal.vuejs2.0 npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls docmob.portal.vuejs2.0 npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/xereda/Sites/docmob.local/docmob.portal.vuejs2.0/npm-debug.log

gary149 commented 7 years ago

Init a new app localy with vue-cli then check the webpack config files to understand

xereda commented 7 years ago

Okay, but imported individually each vue component.

Tks.