我试图添加混音的例子之一,我的图书馆-react18-themes。我有一个工作示例here。然而,当我尝试在monorepo中设置示例时,它会抛出奇怪的错误
TypeError: Unknown file extension ".ts" for ...react18-themes\packages\react18-themes\index.ts
at new NodeError (node:internal/errors:399:5)
remix-example:dev: at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:79:11)
remix-example:dev: at defaultGetFormat (node:internal/modules/esm/get_format:121:38)
remix-example:dev: at defaultLoad (node:internal/modules/esm/load:81:20)
remix-example:dev: at nextLoad (node:internal/modules/esm/loader:163:28)
remix-example:dev: at ESMLoader.load (node:internal/modules/esm/loader:605:26)
remix-example:dev: at ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:22)
remix-example:dev: at new ModuleJob (node:internal/modules/esm/module_job:64:26)
remix-example:dev: at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:480:17)
remix-example:dev: at ESMLoader.getModuleJob (node:internal/modules/esm/loader:434:34)
它可以从this branch复制。操作系统- Windows 11。
我不知道这里出了什么问题,为什么remix试图访问packages\react18-themes\index.ts
文件,即使我用^1.0.8
替换workspace:*
。
1条答案
按热度按时间x6h2sr281#
感谢@jrestall。我需要添加以下配置,并添加remix example所依赖的工作区所使用的所有依赖项。
注意:
serverDependenciesToBundle: ["react18-themes", "shared-ui"]