我正在使用next.js 13.1.1,并且第一次使用turborepo配置基于monoRepo的项目。
- @next/束分析仪
- @哨兵/下一个
- @下一个-pwa
没有上述配置,一切都能正常工作
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
poweredByHeader: false,
compress: true,
transpilePackages: ['ui']
}
module.exports = nextConfig
但如果我用下面的代码
module.exports = withNextPwa(withBundleAnalyzer(
withSentryConfig({
nextConfig,
sentryWebpackPluginOptions,
})
));
获取错误
../../packages/ui/components/Button.tsx
Module parse failed: Unexpected token (4:28)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
import { ButtonProps } from "../type";
|
> export const Button = (props:ButtonProps) => {
| return <button>{props.label}</button>
| }
Import trace for requested module:
../../packages/ui/components/Button.tsx
../../packages/ui/index.tsx
./src/components/home/hero.tsx
./src/components/home/index.tsx
我已经花了一天多的时间来解决这个问题,但没有运气。任何建议或指导是欢迎提前感谢
1条答案
按热度按时间zdwk9cvp1#
我不知道为什么,但当我添加transpilePackages甚至空,它的工作:
一些虫子?