Building a React NextJS and rollup bumps into the following error:
rollup.config.js
:
import json from '@rollup/plugin-json';
import typescript from '@rollup/plugin-typescript';
import ts from "rollup-plugin-ts";
import jsx from 'acorn-jsx';
import tsConfig from './tsconfig.json';
const config = [
{
input: "index.ts",
output: [{ file: "build/index.js", sourcemap: true }],
acornInjectPlugins: [jsx()],
plugins: [
typescript(
{
sourceMap: tsConfig.compilerOptions.sourceMap
}
),
json()
]
},
{
input: "index.ts",
output: [{ file: "build/index.d.ts", "format": "es" }],
acornInjectPlugins: [jsx()],
plugins: [
ts(
{
compilerOptions: {
baseUrl: tsConfig.compilerOptions.baseUrl
}
}
),
json()
]
},
]
export default config;
2: import clsx from "clsx";
3: import { sortBy } from "lodash";
4: import { DragDropContext, Draggable, Droppable } from "react-beautiful-dnd";
^
5: import { Direction } from "react-beautiful-dnd/src/types";
6: import makeStyles from "@mui/styles/makeStyles";
...and 2 other occurrences
[!] (plugin Typescript) TS8006: 'import type' declarations can only be used in TypeScript files.
node_modules/react-beautiful-dnd/src/types.js (2:1)
2 import type { BoxModel, Rect, Position } from 'css-box-model';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
in VSCode:
Make sure you have the extension Flow Language Support installed.
Go to extensions and disable TypeScript and JavaScript Language
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With