-
Notifications
You must be signed in to change notification settings - Fork 395
Closed
Labels
bugSomething isn't workingSomething isn't workingwontfixThis will not be worked onThis will not be worked on
Description
I am not sure what maybe wrong as I am basically copying over the existing sample code for NextJS using app router on NextJS 14.
Here is the content of my .babelrc.js file:
const path = require('path');
module.exports = {
presets: ['next/babel'],
plugins: [
[
'@stylexjs/babel-plugin',
{
dev: process.env.NODE_ENV === 'development',
runtimeInjection: false,
genConditionalClasses: true,
treeshakeCompensation: true,
unstable_moduleResolution: {
type: 'commonJS',
rootDir: path.join(__dirname, '../..'),
},
},
],
],
};and here is my next.config.js file
const withNextIntl = require('next-intl/plugin')();
const stylexPlugin = require('@stylexjs/nextjs-plugin');
const babelrc = require('./.babelrc.js');
const plugins = babelrc.plugins;
const [_name, options] = plugins.find(
(plugin) => Array.isArray(plugin) && plugin[0] === '@stylexjs/babel-plugin',
);
const rootDir = options.unstable_moduleResolution.rootDir ?? __dirname;
module.exports = withNextIntl(stylexPlugin({
rootDir,
useCSSLayers: true,
})({}));Unfortunately, anytime I start the app I keep getting this error:
Syntax error: "next/font" requires SWC although Babel is being used due to a custom babel config being present.
Read more: https://nextjs.org/docs/messages/babel-font-loader-conflict
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingwontfixThis will not be worked onThis will not be worked on