Posts

Showing posts with the label webpack

Webpack 5 and Storybook 6 integration throws an error in DefinePlugin.js

6 1 Working on Webpack 5 and Storybook integration in our React apps' repository. Mainly upgrading from Webpack v4 to v5 because its support has been announced here in this blog post officially. Following the suggested full instructions. With the below mentioned setup I get the following error message on the console: <i> [webpack-dev-middleware] wait until bundle finished 10% building 0/1 entries 0/0 dependencies 0/0 modulesℹ 「wdm」: wait until bundle finished: /opt/app/node_modules/webpack/lib/DefinePlugin.js:549 const oldVersion = compilation.valueCacheVersions.get(name); ^ TypeError: Canno...

React-Native: Module AppRegistry is not a registered callable module

I'm currently trying to get the ES6 react-native-webpack-server running on an Android emulator. The difference is I've upgraded my package.json and build.grade to use react 0.18.0 , and am getting this error on boot. As far as I'm aware AppRegistry is imported correctly. Even if I were to comment out the code this error still comes up. This does work on iOS without issue. What am I doing wrong? EDIT: After trying other boilerplates that do support 0.18.0, I'm still coming across the same issue. i just upgraded to react-native 0.18.1 today tough having some peer dependencies issues with 0.19.0-rc pre-release version. Back to your question, what I did was cd android sudo ./gradlew clean then back to the working directory and run react-native run-android you should restart your npm too after that upgrade. hope this works for you. I had the same issue on ios and the cause for me what that my index.io.js was incorrect (because I c...

Merge react app with react native app

I want to put React app files in the React Native app. I used React Native Web to support React Native components in the React app. Last step I want to put all files from React App folder to React Native App folder. the difference is in Package.json React Package.json : { "name": "appname", "version": "0.1.0", "private": true, "dependencies": { "react": "^15.6.1", "react-dom": "^15.6.1", "react-scripts": "1.0.10" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" } } React Native Package.json: { "name": "appname", "version": "0.0.1", "private": true, ...

React + React Native in same project

Helo, I have a project for web using react and for native using react-native and share some code. The react-native is working, but the web version is not working in the same code base, if i remove the react-native code and libraries the web version is working. I think the problem is on webpack configuration, i have tryed a lot o version but in snot working. For the web to start the server i use: "webpack-dev-server --content-base dist/ --config webpack/web.dev.config.js --port 3000 --inline --hot --colors --historyApiFallback", My webpack config file: const path = require('path') const webpack = require('webpack') const ExtractTextPlugin = require('extract-text-webpack-plugin') const autoprefixer = require('autoprefixer') const extractLess = new ExtractTextPlugin('css/style_webpack.css') module.exports = { devtool: 'eval', entry: [path.resolve(__dirname, '../src/web/index')], cache: true, ...