You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I specify the module generator in tsconfig.json to esnext. I doesn't work. I got an error log like this
(function (exports, require, module, __filename, __dirname) { import * as Express from "express";
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Module.m._compile (C:\Users\KawinGlomjai\axia-insurance-website\node_modules\ts-node\src\index.ts:422:23)
at Module._extensions..js (module.js:646:10)
at Object.require.extensions.(anonymous function) [as .ts] (C:\Users\KawinGlomjai\axia-insurance-website\node_modules\ts-node\src\index.ts:425:12)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
in the other hand, i change to commonjs It pretty work fine. unless I change the whole import codes to import React from 'react' to import * as React from 'react' instead. Do you have any idea how to work on esnext module?
The text was updated successfully, but these errors were encountered:
I specify the module generator in
tsconfig.json
toesnext
. I doesn't work. I got an error log like thisin the other hand, i change to
commonjs
It pretty work fine. unless I change the whole import codes toimport React from 'react'
toimport * as React from 'react'
instead. Do you have any idea how to work on esnext module?The text was updated successfully, but these errors were encountered: