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 put in package.json : "type":"module" and change in tsconfig: "target":"es2020". Then I run tsc && node src/index.js. Node says, that it cannot find src/counter/counter.
I change in src/index.ts the first line to import {Counter} from './counter/counter.js', the second line to import {someHelpfulFunction} from './util.js' and repeat tsc && node src/index.js. This works.
I delete src/*.jsand src/counter/counter.js and call rollup. It says Error: Could not resolve './util.js' from src/index.ts
I cannot write import {Counter} from './conter/counter.ts', because tsc does not allow this, see also microsoft/TypeScript#38546.
Please update the example, so that it works with TypeScript when target:es2020 and type:module are used and so that the same input files are understood the same way by the typescript compiler, by @rollup/plugin-babel/@babel/preset-typescript and by NodeJS.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
I put in package.json :
"type":"module"
and change in tsconfig:"target":"es2020"
. Then I runtsc && node src/index.js
. Node says, that it cannot findsrc/counter/counter
.I change in src/index.ts the first line to
import {Counter} from './counter/counter.js'
, the second line toimport {someHelpfulFunction} from './util.js'
and repeattsc && node src/index.js
. This works.I delete
src/*.js
andsrc/counter/counter.js
and call rollup. It saysError: Could not resolve './util.js' from src/index.ts
I cannot write
import {Counter} from './conter/counter.ts'
, because tsc does not allow this, see also microsoft/TypeScript#38546.Please update the example, so that it works with TypeScript when target:es2020 and type:module are used and so that the same input files are understood the same way by the typescript compiler, by
@rollup/plugin-babel
/@babel/preset-typescript
and by NodeJS.The text was updated successfully, but these errors were encountered: