Next.js 下一个js zero配置中的模块解析失败
接下来,它似乎不处理传输,但根据文档,它应该传输所有react组件Next.js 下一个js zero配置中的模块解析失败,next.js,Next.js,接下来,它似乎不处理传输,但根据文档,它应该传输所有react组件 yarn run v1.15.2 $ next [ wait ] starting the development server ... [ info ] waiting on http://localhost:3000 ... [ ready ] compiled successfully [ info ] ready on http://localhost:3000 [ event ] client pings, bu
yarn run v1.15.2
$ next
[ wait ] starting the development server ...
[ info ] waiting on http://localhost:3000 ...
[ ready ] compiled successfully
[ info ] ready on http://localhost:3000
[ event ] client pings, but there's no entry for page: /_error
[ event ] build page: /
[ wait ] compiling ...
[ error ] C:/Users/danie/Documents/Projects/next-step/pages/index.js 5:4
Module parse failed: Unexpected token (5:4)
You may need an appropriate loader to handle this file type.
| export default () => {
| return (
> <div>
| <p>Ciao</p>
| </div>
[ event ] build page: /next/dist/pages/_error
[ wait ] compiling ...
[ error ] C:/Users/danie/Documents/Projects/next-step/pages/index.js 5:4
Module parse failed: Unexpected token (5:4)
You may need an appropriate loader to handle this file type.
| export default () => {
| return (
> <div>
| <p>Ciao</p>
| </div>
这是应该渲染的组件
// dummy component under /pages
import React from 'react';
export default () => {
return (
<div>
<p>Hi</p>
</div>
);
};
//虚拟组件位于/pages下
从“React”导入React;
导出默认值()=>{
返回(
嗨
);
};
它应该根据文档呈现一个虚拟页面。已解决
这是我的用户文件夹中的环境问题。
这是一个全局巴别塔设置,只会干扰nextjs包,删除包含存储信息的目录就足够了。解决了
这是我的用户文件夹中的环境问题。
这是一个全局巴别塔设置,只会干扰nextjs软件包,删除包含存储信息的目录就足够了。Hey@danielo,你能详细介绍一下你所做的吗?按照nextjs.org页面上的教程,我尝试在windows上安装一个基本的nextjs应用程序,但没有成功,以同样的方式失败了。抱歉耽搁了。查看您的用户文件夹(在windows C:\Users\)并删除
。babel
文件夹已隐藏。那么,它是否还能继续发挥作用呢?Hey@danielo,你能说得更清楚一些吗?按照nextjs.org页面上的教程,我尝试在windows上安装一个基本的nextjs应用程序,但没有成功,以同样的方式失败了。抱歉耽搁了。查看您的用户文件夹(在windows C:\Users\)并删除。babel
文件夹已隐藏。那么,它是否应该再次发挥作用
// dummy component under /pages
import React from 'react';
export default () => {
return (
<div>
<p>Hi</p>
</div>
);
};