Skip to content
Advertisement

Tag: webpack

React-select library crashing my page on render

I am currently attempting to implement react-select into a web-app I am developing, but whenever it is rendered it crashes the entire react application with minified error #130 – Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. The code which procedurally generates these select elements looks as such And

How to display build version in React/webpack app

I need to version every build and display it in app. I’ve tried to use this tutorial but it didn’t work for me https://dmitriy-comarov.medium.com/app-version-from-package-json-with-react-and-webpack-84097bd3f4f9 Is there any way to make it work? Answer You still can follow this tutorial above but if you are not using typescript you don’t have to declare ‘VERSION’ variable. You can call it straight from

How to define custom Express.js route for vite dev server

I am translating my app from webpack configuration into vite. My current webpack dev server has custom endopint configured for doing some stuff. I need to have this same endpoint in vite config as well. How to do this? How can I define an express.js route for vite dev server? This endpoint is for loading environment variables from a service

Babel 7.18 doesn’t transpile components outside the project root directory

I have a component sharedlib outside the babel root directory of project1. I used to use webpack to package this project without problems, but when I configured babel, I got the following error: The demo project to reproduce the problem is on github https://github.com/xybei/test_babel My project directory is like this: Here’s the project1/package.json, I have configured sharedlib as a local

how to enable top level await in reactjs

I have installed craco using yarn add @craco/craco I have also replaced the scritps and have created a craco.config.js but when I’m trying to use await at top level I’m still getting this error in my react app Answer In the craco docs, it says you need to add a configure block to handle any webpack configuration options ` What

Advertisement