Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Turbopack] Parsing css source code failed #1122

Closed
rwieruch opened this issue Jan 22, 2024 · 7 comments
Closed

[Turbopack] Parsing css source code failed #1122

rwieruch opened this issue Jan 22, 2024 · 7 comments

Comments

@rwieruch
Copy link

Bug report in v4

vercel/turborepo#2356 (comment)

Trying to use Turbopack in Next.js with the latest Leaflet/Leaflet-React version yields the error from the linked Issue. A Turbopack maintainer mentioned that Leaflet does not use valid syntax here.

@jpainam
Copy link

jpainam commented Feb 11, 2024

Is t here any update for this issue? @rwieruch How did you solve it?
Thanks

@rwieruch
Copy link
Author

rwieruch commented Feb 12, 2024

Did not solve it. Cannot use Turbopack until this is fixed :)

But I think there is enough pressure on Library Maintainers with all these recent changes in the React/Next community, so I'd hope that someone else may see this as a good first issue to contribute to open source :)

@rwieruch
Copy link
Author

Related vercel/turborepo#2356 (comment)

@rinvii
Copy link

rinvii commented Mar 12, 2024

I'm getting a similar error

Screen Shot 2024-03-12 at 8 28 35 AM

@shenst1
Copy link

shenst1 commented Mar 22, 2024

@rwieruch I was able to do a workaround using the cdn:

Map.tsx
import "./Map.css";
Map.css
@import url('https://unpkg.com/leaflet@1.9.4/dist/leaflet.css');

@mattmchugh4
Copy link

I was unable to reproduce this issue mentioned. My setup includes the following versions:

  • Next.js: 14.2.5
  • Leaflet: 1.9.4
  • React-Leaflet: 4.2.1
  • React: 18
  • Turbopack: used with next dev --turbo

Everything seems to be working fine, and the Leaflet CSS is being bundled without any errors.

If there was an issue, it appears it might have been related to the default Leaflet CSS. According to the vercel/turborepo#2356 (comment), the problem might have been caused by old CSS in Leaflet that's since been removed or updated.

Given that I don't see the issue occurring, I think this should be closed. However, if anyone encounters the problem again, please list your dependencies / provide an example.

@lethal-bot
Copy link

@shenst1 solution works with turbo pack of nextjs.
just paste this to global.css of your project @import url('https://unpkg.com/leaflet@1.9.4/dist/leaflet.css'); and yes import 'leaflet/dist/leaflet.css' is still causing issues with next dev --turbo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants