Closed ivoba closed 1 month ago
Based on the description I doubt it's Turbopack specific, the warnings would be coming from the schema validation in Next.js, so would happen when using Webpack too. Sounds like an easy fix though, removing .min(1) here: https://github.com/vercel/next.js/blob/9a1b2b70afe74f15d4bd0a48f3a7ecbff0e9dade/packages/next/src/server/config-schema.ts#L205 (and in the other place it's used)
Asked @samcx to have a look 👍
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Link to the code that reproduces this issue
https://github.com/ivoba/turborepo-styledcomponents-warning
To Reproduce
Current vs. Expected behavior
Using the recommended styledComponents config from here: https://nextjs.org/docs/architecture/nextjs-compiler#styled-components
This will render a warning:
⚠ Array must contain at least 1 element(s) at "compiler.styledComponents.topLevelImportPaths" ⚠ Array must contain at least 1 element(s) at "compiler.styledComponents.meaninglessFileNames"
Json schema definition: https://github.com/vercel/turbo/blob/49c67593edb6c2c1389d38ab61cbb3ece3810c92/crates/turbopack-ecmascript-plugins/src/transform/styled_components.rs#L34C13-L34C35
This should probably allow empty Arrays, same goes for meaninglessFileNames.
There should be no confusing warnings for the recommended styledComponents configuration.
Provide environment information
Which area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I first filed this issue in Turborepo repo since it looked Turbopack was located there: https://github.com/vercel/turbo/issues/8941 But i was told, Turbopack lives now at Next.js :)