npm - 在安装后脚本中运行“下一个构建”后出现“需要适当的加载器”错误
问题描述
这是复制回购: https ://github.com/stomvi/nextjs-postinstall-build
赶紧跑:
npm i -g git+ssh://git@github.com:stomvi/nextjs-postinstall-build.git
我将 next.js 用作本地 Web 服务器,作为 cli 工具的一部分。我想在安装工具后构建 next.js 服务器,所以我将next build
脚本postinstall
放在package.json
. 安装失败并显示“您可能需要适当的加载程序来处理此文件类型,当前没有配置加载程序来处理此文件。” 错误。
使用-next.js v9.0.4-npm 6.9.0
该错误表明可能没有jsx
文件加载器。本地npm link
工作正常。
Failed to compile.
./pages/logs/[page].js 11:4
Module parse failed: Unexpected token (11:4)
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
|
| return (
> <Layout>
| <div className="card filter-container">
| <div className="card-header">
> Build error occurred
Error: > Build failed because of webpack errors
我怎样才能使这项工作?目前我只是将目录提交.next
到 repo 中。
解决方案
推荐阅读
- paraview - 在 Paraview 中计算张量的转置
- python - 使用 jinja(烧瓶)在 2 个单独的列中使用 2 个循环数据?
- ios - 旁白:UIAccessibilityLayoutChangedNotification 不起作用
- python-3.x - 跨两个列表框移动项目时,Python tkinter 保持名称顺序一致
- typescript - typescript 动态导入与 tsconfig.json 中的 webpack.config 冲突?
- python - 从包含python中字典的嵌套列表创建字典
- python-3.x - 单个轮廓的边界框,一种颜色除外
- reactjs - 无法正确地将值从父母传递给孩子和孩子传递给父母
- julia - 如何使用DifferentialEquations.jl消除具有不确定形式的微分方程的解中的振荡
- caching - 在 Apache Ignite 中获取数据区域的 maxSize