Next.js Typescript Compilation Warning
See original GitHub issue🐛 Bug Report
I got a postcss error while using react-spectrum with Next.js 12 & Typescript.
🤔 Expected Behavior
There shouldn’t be any warning or errors.
😯 Current Behavior
Error prevents the UI from re-rendering with new styles.
wait - compiling / (client and server)...
warn - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[2].oneOf[7].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[2].oneOf[7].use[2]!./node_modules/@react-spectrum/breadcrumbs/dist/main.css
Warning
(1:83) postcss-preset-env: start value has mixed support, consider using flex-start instead
🔦 Context
Trying to test out react spectrum components with Next.js 12 and typescript.
💻 Code Sample
_app.tsx
function MyApp({ Component, pageProps }: AppProps) {
const { locale } = useLocale();
return (
<SSRProvider>
<Provider theme={lightTheme} locale={locale}>
<Component {...pageProps} />
</Provider>
</SSRProvider>
);
}
next.config.js
const withTM = require('next-transpile-modules')([
'@adobe/react-spectrum',
...
]);
module.exports = withTM({
reactStrictMode: true,
});
🌍 Your Environment
| Software | Version(s) |
|---|---|
| react-spectrum | ^3.15.0 |
| Browser | Chrome@latest |
| Operating System | MacOs M1 |
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Ignoring TypeScript Errors - next.config.js
Ignoring TypeScript Errors. Next.js fails your production build ( next build ) when TypeScript errors are present in your project. If you'd like ......
Read more >A Guide for Next.js with TypeScript - Refine Dev
If you happen to have TypeScript errors while running next build , Next.js will fail the build but you can disable the type...
Read more >Next.js, TypeScript, ESLint. Compilation - Stack Overflow
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. The file does not match your project config: src ...
Read more >isolatedModules - TSConfig Option - TypeScript
While you can use TypeScript to produce JavaScript code from TypeScript code, ... Setting the isolatedModules flag tells TypeScript to warn you if...
Read more >How To Ignore The Next Line In TypeScript? - Tim Mousk
The TypeScript compiler is excellent at showing errors and warning when it detects something is wrong with the code.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

ok, I took a look, here it is working https://codesandbox.io/s/relaxed-hoover-45cut?file=/pages/_app.tsx
you’ve conflated colorScheme and theme for your provider props, see https://react-spectrum.adobe.com/react-spectrum/Provider.html#themes
Oh I see, I cloned the repo that @reidbarber provided. I hope they fix the warning issues in the next update regarding
postcss-preset-env