Comments (16)
@jamesrweb I can try updating vite in my personal project that uses it to build the app including the react p5 wrapper, and reproduce the issue if possible. I will let you know tomorrow
from react.
Thanks for your help everyone
from react.
Can you share your vite config for v4.5 and v5?
from react.
Sure thing. :)
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
import { compression } from 'vite-plugin-compression2'
import svgr from 'vite-plugin-svgr'
// https://vitejs.dev/config/
export default defineConfig({
assetsInclude: ['**/*.md'],
plugins: [
compression({
algorithm: 'gzip',
include: /\.(js|mjs|json|css|svg)$/i,
}),
react(),
svgr(),
],
})
from react.
I am having the same issue
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
from react.
@lewiswolf @RossKlein So you're telling me that v4.x vite works fine but v5.x is broken and you didn't change the config between versions or anything? To be honest I haven't looked into v5.x yet myself and I can only think that since its a major version change, perhaps the react
plugin hasn't updated yet OR that v5.x introduced breaking changes causing this. It should "just work". I will be making a release tonight or tomorrow but I doubt that will change anything since the repo changes are internal type changes and dependency updates mostly. What do you guys think?
from react.
Having mostly the same issue
error during build:
RollupError: Identifier "r" has already been declared
error happens at the same line
at error ([project-root]/node_modules/rollup/dist/es/shared/parseAst.js:337:30)
from react.
@jamesrweb I can try updating vite in my personal project that uses it to build the app including the react p5 wrapper, and reproduce the issue if possible. I will let you know tomorrow
Sounds good @yevdyko, thank you 🙏🏻
from react.
@jamesrweb for me it is acceptable to use 4.5 so I downgraded vite. With no other changes p5 wrapper worked.
from react.
@RossKlein @lewiswolf @yevdyko it is definitely a breaking change somewhere from Rollup / Vite. I tested upgrading Vite to v5 for this library and the same issue happens as you get also. I guess it's a "read the docs for your own project" scenario guys!
from react.
@jamesrweb wait sorry, I don’t understand what you mean. Is this something that you can’t fix?
from react.
@jamesrweb wait sorry, I don’t understand what you mean. Is this something that you can’t fix?
Exactly, it's a Vite 5 or Rollup breaking change. Not related to this library.
from react.
@lewiswolf I tried to upgrade my app to vite version 5 and got the same rollup build error: rollup/rollup#5259
It looks like they fixed it in rollup version 4.5.1, but it still doesn't work for me and it's definitely not related to this react component
from react.
@yevdyko Use version 4.5.0 it works
from react.
@RossKlein yeah, I meant that there was an attempt to fix the problem in rollup with version 4.5.1, but the previous vite version as 4.5.0 works, that's true
from react.
FYI: I had a successful build with these versions:
- @vitejs/plugin-react: 4.2.0
- vite: 5.0.4
from react.
Related Issues (20)
- Could not find a declaration file but the code works HOT 10
- Duplicate canvas when running in vite dev HOT 5
- TypeError: p5.loadSound is not a function HOT 4
- P5-wrapper size HOT 5
- Stop rerender of p5 component when redux variables update HOT 3
- Latest commits not in the npm registry HOT 5
- npm ERR! Usage Error: This project is configured to use npm HOT 2
- windowResized() not firing HOT 4
- Error in nextjs HOT 7
- Change p5 dependency version to minimum 1.4.1 HOT 9
- Examples directory doesn't exist, link broken on README HOT 3
- Module parse failed: Identifier 'XX' has already been declared (7762:41) HOT 3
- Is this package supported in React Native? HOT 1
- How to access custom props using abstracted updateWithProps
- Custom updaters as props for use in abstracted methods
- Missing typings for `ReactP5WrapperGuard` in 5.0.0-rc.0 HOT 2
- npm package for version 4.4.1 is empty HOT 3
- It creates new canvas once state is changed HOT 3
- How can I use @P5-wrapper/react in react native HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.