score:0
I cloned your repo and it seems there are several things wrong with your setup.
- Typo in babel.config.js. Remove the extra comma.
Change this:
presets: [require("@babel/preset-env"), , require("@babel/preset-react")],
To this:
presets: [
require("@babel/preset-env"),
require("@babel/preset-react"),
],
- Typo in rollup.config.js:
Change this:
pulugs:[ ... ],
To this:
plugins:[ ... ],
- Having corrected these two errors, I ran
npm run build:rollup
and got the message "No ESLint configuration found", so I added the following topackage.json
:
"eslintConfig": {},
- I then ran
npm run build:rollup
again and got the next error message: "Parsing error: The keyword 'import' is reserved". To fix this, install babel-eslint (npm install babel-eslint --save-dev
) and adjust theeslintConfig
inpackage.json
as follows:
"eslintConfig": {
"parser": "babel-eslint"
},
See here for more details: Parsing Error The Keyword import is Reserved (SublimeLinter-contrib-eslint)
- I then ran
npm run build:rollup
again and saw yet another error message: "Invalid value for option "output.dir" - you must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks."
Looking at your rollup config, you have this:
output:{
dir:pkg.main,
file:'index.js',
format:'es',
name:appName
},
You need to remove either the dir
or file
key. I removed the dir
key, giving me this:
output:{
file:'index.js',
format:'es',
name:appName
},
Now when I ran npm run build:rollup
, the bundle was created in the project root, as specified in your rollup config.
I appreciate that you have made a slimmed down version of the problem you are experiencing, so you might not need to follow all of the steps I have posted above.
HTH
Source: stackoverflow.com
Related Query
- trying to build rollup + babel + react starter, but get error during the building
- Trying to deploy my React app with gh-pages but got this error message : The "file" argument must be of type string. Received type undefined
- The React App works during `npm start` but returns 404 after build
- Trying to deploy my REACT Webpack app to heroku. Everything works locally and the heroku build works. But I'm getting a 404 nginx
- Trying to integrate jest and react with amchart but getting an error . What could be the issue?
- In React JS I'm trying to create a countdown timer but can't get the first second to be a full second
- What's the best way to deal with an error about an unmounted component? Trying to implement CKEditor but get this error
- I get this error when trying to connect to a graphcool relay API from a react app: Module build failed: Error: No valid GraphQL endpoint
- Set the react CSS loader in locally, but I get an error
- i'm trying to make a axiosGET request to my react component, i get the object on the console.log. But when i try to render it i get a "is not defined"
- Error when trying to get info from current session user. "Too many re-renders. React limits the number of renders to prevent an infinite loop."
- I am trying to start a new react project But I am getting this error and the app is not created. I have installed react globally
- Trying to add an array of objects using react useState but getting the error 'Objects are not valid as a React child (found: object with keys {})'
- With react , I am trying to add a section where it shows facts for 5 second intervals. No error shown, but the facts aren't appearing on the page
- Trying to use cookies in my react app but can't get them on the server?
- I am trying to connect Lottery Contract to React Application using Metamask, But when I call manager() method on the contract I get an empty array
- Trying to deploy my react app on Netlify which I created on a local host, but get an error while trying to deploy
- Trying to fetch the api but react gives an error
- Typescript 3.7.2, React and Material UI 4.5.1 Snackbars - trying to do an error popup but get styles errors
- Getting the error "Nested CSS was detected, but CSS nesting has not been configured correctly" in React app?
- Next.js 'Error occurred prerendering page "/": Error: Minified React error #321;' during production build
- Fetch api post call returning 403 forbidden error in React js but the same URL working in postman
- Apollo - React (Typescript) Invariant Error when building production build
- Error trying to install react native, not building correctly when running pod install
- "Missing the cookie header or object" error thrown during react smoke tests (Create-react-app)
- Getting an error trying to start React right after (There might be a problem with the project dependency tree....)
- React styled component causes build error in production, but runs fine in development
- `Invalid mapping` error trying to use babel require hook and polyfill with react jsx transpile
- Page works on initial page load, but if i refresh the page I get an 404 error with Zeit, Nextjs & now
- Gatsby works fine during development but throws error during build
More Query from same tag
- How to ignore child element active region when parent:active is enable?
- How to have sub components CSS class react on parent components CSS class?
- How to show just an elements in React Native's Flatlists
- Showing google Recaptcha V3 floater only on specific Pages of React Application
- (...Array([random number]).keys().toString()) why the length and values of this expression always gives the same result?
- HTML tags are not rendered while iterating over an array in ReactJS
- Formik Select label as Placeholder
- How to fix Too many re-renders. React limits the number of renders to prevent an infinite loop
- react js user gets redirected to another page on refresh
- Pass map's argument to function in ReactJS
- How to update child's(from the created list) props from parent
- How to use react-hook-form with my customized react-date-picker?
- React useEffect() Infinite loop with firebase and react-router
- How to let Material-UI input field fill toolbar
- Editing only the real DOM on ReactJS in order to present a formated number/string maintaining the real number
- React render siblings on Multiple Select Material UI
- Having trouble with React Hooks and States. Trying to make a password strength meter
- How to setState multiple states?
- Warning: Each child in a list should have a unique "key" prop. - ReactJS
- Unable to find functions or node when testing a nested component in Jest/Enzyme
- input field onChange to setState value is an action behind (need to click out)
- Action invoked without dispatching it - Redux
- im getting Error: Actions must be plain objects. Use custom middleware for async actions
- make a multi-selector that gets The state first then the city . React
- Test failures during styles file imports
- Put length constraint in a TextField in react js
- react-hot-toast custom positioning overlay
- Login and authentication for route (react or server side)
- How to make a choose file action in Chonky.js
- Webpack taking ages to load page AFTER build is complete