Skip to content
This repository has been archived by the owner on Nov 26, 2021. It is now read-only.

Module parse failed #48

Closed
saaiful opened this issue Dec 27, 2016 · 3 comments
Closed

Module parse failed #48

saaiful opened this issue Dec 27, 2016 · 3 comments

Comments

@saaiful
Copy link

saaiful commented Dec 27, 2016

I'm using vue.js 2.0 with laravel elixir, after installing 'vue-tables-2' and impotring in app.js I'm getting folowing error. I installed https://github.com/vuejs/babel-plugin-transform-vue-jsx this plugin nad created a 'webpack.config.js' file in my project root with:

module.exports = {
	module: {
		loaders: [{
			test: /\.jsx?$/,
			loader: 'babel',
			exclude: /node_modules(?!\/(vue-tables-2|vue-pagination-2))/
		}]
	}
}
  • Vue.js 2.0:
  • consumed using: (elixir)
  • FULL error message (including stack trace):
ERROR in ./~/vue-tables-2/lib/template.jsx
Module parse failed: E:\wamp64\www\green\node_modules\vue-tables-2\lib\template.jsx Unexpected token (15:7)
You may need an appropriate loader to handle this file type.
| var perPage = require('./template/per-page.jsx')(h, this);
|
| return <div class={"VueTables VueTables--" + this.source}>
|   <div class="row">
|     <div class="col-md-6">
 @ ./~/vue-tables-2/lib/v-client-table.js 11:15-40
 @ ./~/vue-tables-2/index.js
 @ ./resources/assets/js/app.js

ERROR in ./~/vue-tables-2/lib/methods/render.js
Module parse failed: E:\wamp64\www\green\node_modules\vue-tables-2\lib\methods\render.js Unexpected token (17:9)
You may need an appropriate loader to handle this file type.
|           });
|
|   return <span class='VueTables__template'>{template}</span>
|
| }
 @ ./~/vue-tables-2/lib/mixins/methods.js 27:14-42
 @ ./~/vue-tables-2/lib/table.js
 @ ./~/vue-tables-2/lib/v-client-table.js
 @ ./~/vue-tables-2/index.js
 @ ./resources/assets/js/app.js

ERROR in ./~/vue-pagination-2/src/template.jsx
Module parse failed: E:\wamp64\www\green\node_modules\vue-pagination-2\src\template.jsx Unexpected token (8:8)
You may need an appropriate loader to handle this file type.
|   this.pages.map(function(page) {
|       items.push(
|         <li class={"VuePagination__pagination-item page-item "+this.activeClass(page)}>
|         <a class="page-link" href="javascript:void(0);"
|         on-click={this.setPage.bind(this, page)}>{page}</a>
 @ ./~/vue-pagination-2/src/Pagination.js 1:15-40
 @ ./~/vue-pagination-2/index.js
 @ ./~/vue-tables-2/lib/v-client-table.js
 @ ./~/vue-tables-2/index.js
 @ ./resources/assets/js/app.js
@BingBlog
Copy link

On window I think you should change the '/' wiith '\'.

@BingBlog
Copy link

module.exports = {
	module: {
		loaders: [{
			test: /\.jsx?$/,
			loader: 'babel',
			exclude: /node_modules(?!\/(vue-tables-2|vue-pagination-2))/
		}]
	}
}

Look at all the /\

@joshuamurray
Copy link

joshuamurray commented Jan 4, 2017

I had a similar issue. Resolved by adding the ".babelrc" file from this repository to the project root.

@matfish2 matfish2 closed this as completed Jan 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants