aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
16.26k stars 574 forks source link

[BUG] Taking syntax error when running the millionjs sample. #49

Closed fzerman closed 3 years ago

fzerman commented 3 years ago

My node.js code:

const { m, createElement, patch } = require('million');

const app = createElement(m('div', { id: 'app' }, ['Hello World']));

console.log(app);

My node version is 12.16.1. npm is 6.13.4.

Error:

...\node_modules\million\dist\million.umd.js:78
      if (props?.key) {
                ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:1072:16)
    at Module._compile (internal/modules/cjs/loader.js:1122:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (C:\Users\Furkan\Documents\GitHub\Kapseli-UI-Framework\test.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
aidenybai commented 3 years ago

Is this still an issue? I think you need to use a bundler

fzerman commented 3 years ago

Ok. I solved this issue. I tried it on a node.js env instead of the browser. :)