Error: Cannot read properties of undefined (reading 'createContext')
cassio-gamarra opened this issue · 6 comments
cassio-gamarra commented
This errors occurs after build the project. In development time don't happs.
I'm using Vite to build.
My vite.config.ts file:
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
plugins: [react(), tsconfigPaths()],
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return id
.toString()
.split('node_modules/')[1]
.split('/')[0]
.toString();
}
},
},
},
},
});
Witoso commented
You need to use our Vite plugin as well.
cassio-gamarra commented
Witoso commented
As far as I can see, you're using a predefined build, it doesn't require any Vite plugin, as the code is already built in the npm package.
cassio-gamarra commented
Any idea how i fix the reading 'createContext' error?
Witoso commented
I would appreciate it if you could prepare some reproducible code sample for us (repo or zip).