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

bundlers : Unexpected character '​' #28

Closed
vogloblinsky opened this issue Dec 13, 2018 · 3 comments
Closed

bundlers : Unexpected character '​' #28

vogloblinsky opened this issue Dec 13, 2018 · 3 comments
Labels

Comments

@vogloblinsky
Copy link

using webpack 4.27.1

index.js

import {
    html,
    define
} from 'hybrids';

export function increaseCount(host) {
    host.count += 1;
}​
export const SimpleCounter = {
    count: 0,
    render: ({
        count
    }) => html `
      <button onclick="${increaseCount}">
        Count: ${count}
      </button>
    `,
};​
define('simple-counter', SimpleCounter);
const path = require('path');

module.exports = {
    entry: './js/index.js',
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'bundle.js'
    },
    mode: 'production'
};

Got this error

ash: 87bee4b65e75b1862549
Version: webpack 4.27.1
Time: 268ms
Built at: 2018-12-13 15:14:10
 1 asset
Entrypoint main = bundle.js
[0] ./js/index.js 256 bytes {0} [built] [failed] [1 error]

ERROR in ./js/index.js 10:1
Module parse failed: Unexpected character '​' (10:1)
You may need an appropriate loader to handle this file type.
| export function increaseCount(host) {
|     host.count += 1;
> }​
| export const SimpleCounter = {
|     count: 0,
@smalluban smalluban added the help label Dec 13, 2018
@smalluban
Copy link
Contributor

I think that the main module file for Wepback should not have exports. They are useless here, as the main module is not imported anywhere. Try to remove export keyword.

@vogloblinsky
Copy link
Author

Same error :(

@vogloblinsky
Copy link
Author

Ok just an indentation problem, seems strange.

import {
    html,
    define
} from 'hybrids';

function increaseCount(host) {
    host.count += 1;
}

const SimpleCounter = {
    count: 0,
    render: ({
        count
    }) => html `
    <button onclick="${increaseCount}">
      Count: ${count}
    </button>
  `,
};

define('simple-counter', SimpleCounter);

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

No branches or pull requests

2 participants