yarn run v1.22.19
$ rimraf dist && cross-env NODE_ENV=production rollup -c
src/index.tsx → dist/app.js...
(!) Error when using sourcemap for reporting an error: Can't resolve original location of error.
src/components/Visualizer.tsx (6:9)
(!) Missing exports
https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module
src/components/Visualizer.tsx
InfernoNode is not exported by node_modules/inferno/index.esm.js
4: */
5: // import {createVNode} from "inferno"; // If this line is uncommented, no problems
6: import { InfernoNode, createVNode } from "inferno";
^
7: import { a } from "./test";
8: export function Visualizer(_a) {
created dist/app.js in 679ms
Done in 1.34s.
Go to examples/rollup/src/components/Visualizer.tsx
Uncomment row 5 which is commented (// import {createVNode} from "inferno"; // If this line is uncommented, no problems)
yarn build to build the project again
Output does not have an error anymore:
yarn run v1.22.19
$ rimraf dist && cross-env NODE_ENV=production rollup -c
src/index.tsx → dist/app.js...
created dist/app.js in 650ms
Done in 1.32s.
The transformer uses the first existing inferno import when adding stuff to inferno import. It seems like the transformer updating the import statement somehow messes up the process of removing imported types. This leads to a situation where the imported type is trying to be resolved from node_modules/inferno/index.esm.js instead of node_modules/inferno/index.d.ts.
Expected behavior
Type imports should have been removed when TS files have been compiled to JS.
Type imports are not being removed during compilation
Type imports are not being removed during compilation when they are in the first inferno import statement (
import {...} from 'inferno'
) of a file.Steps to reproduce:
Steps to reproduce:
yarn
to install dependenciesyarn build
to build the projectOutput has an error:
// import {createVNode} from "inferno"; // If this line is uncommented, no problems
)yarn build
to build the project againOutput does not have an error anymore:
The transformer uses the first existing inferno import when adding stuff to inferno import. It seems like the transformer updating the import statement somehow messes up the process of removing imported types. This leads to a situation where the imported type is trying to be resolved from
node_modules/inferno/index.esm.js
instead ofnode_modules/inferno/index.d.ts
.Expected behavior
Type imports should have been removed when TS files have been compiled to JS.