npm start 有 tailwind.js 弹出错误 800A0404 jScript 编译错误然后浏览器屏幕空白
npm start has tailwind.js popup Error 800A0404 jScript compilation error then blank browser screen
当我在门户目录中执行 npm start 时,出现错误消息:
Script: c:\users\me\IdeaProjects\portal\cp-frontend\tailwind.js
Line 32, char 7
Error: expected identifier, string or number
Code: 800A0404.
Source: Microsoft JScript compilation error.
错误消息之前和 npm 启动之后屏幕上的信息是:
>npm start
> start
> concurrently -k -n 'frontend,backend' "npm run start-frontend" "npm run start-backend"
[frontend]
[frontend] > start-frontend
[frontend] > cd cp-frontend && npm run start
[frontend]
[backend]
[backend] > start-backend
[backend] > cd cp-backend && npm run start
[backend]
[frontend]
[frontend] > customer-portal-frontend@0.1.0 start
[frontend] > npm run tailwind:css && react-scripts start
[frontend]
[backend]
[backend] > customer-portal-poc@1.0.0 start
[backend] > nodemon -r dotenv/config index.js
[backend]
[backend] [nodemon] 2.0.2
[backend] [nodemon] to restart at any time, enter `rs`
[backend] [nodemon] watching dir(s): *.*
[backend] [nodemon] watching extensions: js,mjs,json
[backend] [nodemon] starting `node -r dotenv/config index.js`
[backend] Server listening on port: 3002
[frontend]
[frontend] > customer-portal-frontend@0.1.0 tailwind:css
[frontend] > tailwind build src/tailwind.src.css -c tailwind.js -o src/tailwind.css
[frontend]
[frontend] npm run start-frontend exited with code 1
--> Sending SIGTERM to other processes..
[backend] npm run start-backend exited with code 1
我的 tailwind.js 文件如下所示(添加的注释中显示第 32 行):
module.exports = {
theme: {
extend: {
colors: {
primary: '#63ACE5',
background: '#E6EFF6',
'blue-light': '#63ACE5',
'blue': '#4C86B5',
'blue-dark': '#2A4E68',
accent: '#FCAB4D'
},
spacing: {
px: '1px',
'0': '0',
'1': '0.25rem',
'2': '0.5rem',
'3': '0.75rem',
'4': '1rem',
'5': '1.25rem',
'6': '1.5rem',
'8': '2rem',
'10': '2.5rem',
'12': '3rem',
'16': '4rem',
'20': '5rem',
'24': '6rem',
'32': '8rem',
'40': '10rem',
'48': '12rem',
'56': '14rem',
'64': '16rem',
}, //this is line 32
screens: {
'sm': '640px',
// => @media (min-width: 640px) { ... }
'md': '768px',
// => @media (min-width: 768px) { ... }
'lg': '1024px',
// => @media (min-width: 1024px) { ... }
'xl': '1280px',
// => @media (min-width: 1280px) { ... }
}
},
},
variants: {
tableLayout: ['responsive', 'hover', 'focus'],
borderWidth: ['responsive', 'first', 'last', 'hover', 'focus'],
padding: ['responsive', 'first', 'last'],
},
plugins: [],
};
我正在查看这些主题,tailwind file or enter link description here,但由于此网页是产品中的 运行 网页,我怀疑我是否需要编辑顺风文件或重命名文件。
我已经在 IntelliJ idea 中构建了项目。
更新 1:我试过 npm install -g yarn 但仍然收到相同的错误消息。
更新:
我尝试在 cp-frontend 中将 tailwind.js 重命名为 tailwind.config.js,它也在 package.json 中引用。 Npm 启动有错误:
Failed to compile layout.js. Module not found can’t resolve react.router
我做了以下事情:
在根目录和 cp 前端目录中:
npm install react-router-dom
npm install react-router-config
在那之后我没有收到弹出错误,但有错误:
[frontend] Line 21:6: React Hook useEffect has a missing dependency: 'register'. Either include it or remove the dependency array react-hooks/exhaustive-deps
[frontend]
[frontend] ./src/components/user/findProperty/FindProperty.js
[frontend] Line 47:6: React Hook useEffect has a missing dependency: 'register'. Either include it or remove the dependency array react-hooks/exhaustive-deps
[frontend]
[frontend] ./src/components/user/dashboard/PastPayments.js
[frontend] Line 4:8: 'ChevronIcon' is defined but never used no-unused-vars
[frontend] Line 5:8: 'DownloadIcon' is defined but never used no-unused-vars
[frontend]
[frontend] ./src/components/common/alerts/Alerts.js
[frontend] Line 54:6: React Hook useEffect has an unnecessary dependency: 'fetchAlertData'. Either exclude it or remove the dependency array. Outer scope values like 'fetchAlertData' aren't valid dependencies because mutating them doesn't re-render the component react-hooks/exhaustive-deps
[frontend]
[frontend] ./src/components/user/pastBills/PastBills.js
[frontend] Line 66:6: React Hook useEffect has missing dependencies: 'history', 'params', 'serviceAccounts', and 'showFileInUrl'. Either include them or remove the dependency array react-hooks/exhaustive-deps
[frontend] Line 93:11: <iframe> elements must have a unique title property jsx-a11y/iframe-has-title
[frontend]
[frontend] ./src/components/user/dashboard/CustomerSvcTable.js
[frontend] Line 7:22: 'formatCurrencyNum' is defined but never used no-unused-vars
[frontend] Line 34:6: React Hook useEffect has a missing dependency: 'getSvcOrder'. Either include it or remove the dependency array react-hooks/exhaustive-deps
[frontend]
[frontend] ./src/components/user/layout/Layout.js
[frontend] Line 80:6: React Hook useEffect has a missing dependency: 'fetchInitialData'. Either include it or remove the dependency array react-hooks/exhaustive-deps
[frontend] Line 86:20: 'Tawk_API' was used before it was defined no-use-before-define
[frontend] Line 91:9: 'Tawk_LoadStart' is assigned a value but never used no-unused-vars
[frontend]
[frontend] ./src/components/common/navbar/Navbar.js
[frontend] Line 91:15: No duplicate props allowed react/jsx-no-duplicate-props
[frontend]
[frontend] ./src/components/common/card/Card.js
[frontend] Line 94:21: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
[frontend]
[frontend] Search for the keywords to learn more about each warning.
[frontend] To ignore, add // eslint-disable-next-line to the line before.
我现在的问题是,我是否需要将缺少的依赖项添加到前端的 package.json 中?我确定如果我执行 npm install 它们会消失,但我不清楚永久性修复。依赖列表项是否有顺序?浏览器弹出空白屏幕,但调试工具没有显示我能看到的错误。
tailwind-js-popup-error-800a0404- 之后消失了
在 cp-frontend 中将 tailwind.js 重命名为 tailwind.config.js 并且在 package.json 中引用它。 Npm 启动有错误:
编译失败layout.js。找不到模块无法解析 react.router
我做了以下事情:
在根目录和 cp 前端目录中:
npm 安装 react-router-dom
npm 安装 react-router-config
在我将 link 移动到 Edge 而不是 IE 后,黑屏和错误消息消失了。
当我在门户目录中执行 npm start 时,出现错误消息:
Script: c:\users\me\IdeaProjects\portal\cp-frontend\tailwind.js
Line 32, char 7
Error: expected identifier, string or number
Code: 800A0404.
Source: Microsoft JScript compilation error.
错误消息之前和 npm 启动之后屏幕上的信息是:
>npm start
> start
> concurrently -k -n 'frontend,backend' "npm run start-frontend" "npm run start-backend"
[frontend]
[frontend] > start-frontend
[frontend] > cd cp-frontend && npm run start
[frontend]
[backend]
[backend] > start-backend
[backend] > cd cp-backend && npm run start
[backend]
[frontend]
[frontend] > customer-portal-frontend@0.1.0 start
[frontend] > npm run tailwind:css && react-scripts start
[frontend]
[backend]
[backend] > customer-portal-poc@1.0.0 start
[backend] > nodemon -r dotenv/config index.js
[backend]
[backend] [nodemon] 2.0.2
[backend] [nodemon] to restart at any time, enter `rs`
[backend] [nodemon] watching dir(s): *.*
[backend] [nodemon] watching extensions: js,mjs,json
[backend] [nodemon] starting `node -r dotenv/config index.js`
[backend] Server listening on port: 3002
[frontend]
[frontend] > customer-portal-frontend@0.1.0 tailwind:css
[frontend] > tailwind build src/tailwind.src.css -c tailwind.js -o src/tailwind.css
[frontend]
[frontend] npm run start-frontend exited with code 1
--> Sending SIGTERM to other processes..
[backend] npm run start-backend exited with code 1
我的 tailwind.js 文件如下所示(添加的注释中显示第 32 行):
module.exports = {
theme: {
extend: {
colors: {
primary: '#63ACE5',
background: '#E6EFF6',
'blue-light': '#63ACE5',
'blue': '#4C86B5',
'blue-dark': '#2A4E68',
accent: '#FCAB4D'
},
spacing: {
px: '1px',
'0': '0',
'1': '0.25rem',
'2': '0.5rem',
'3': '0.75rem',
'4': '1rem',
'5': '1.25rem',
'6': '1.5rem',
'8': '2rem',
'10': '2.5rem',
'12': '3rem',
'16': '4rem',
'20': '5rem',
'24': '6rem',
'32': '8rem',
'40': '10rem',
'48': '12rem',
'56': '14rem',
'64': '16rem',
}, //this is line 32
screens: {
'sm': '640px',
// => @media (min-width: 640px) { ... }
'md': '768px',
// => @media (min-width: 768px) { ... }
'lg': '1024px',
// => @media (min-width: 1024px) { ... }
'xl': '1280px',
// => @media (min-width: 1280px) { ... }
}
},
},
variants: {
tableLayout: ['responsive', 'hover', 'focus'],
borderWidth: ['responsive', 'first', 'last', 'hover', 'focus'],
padding: ['responsive', 'first', 'last'],
},
plugins: [],
};
我正在查看这些主题,tailwind file or enter link description here,但由于此网页是产品中的 运行 网页,我怀疑我是否需要编辑顺风文件或重命名文件。
我已经在 IntelliJ idea 中构建了项目。
更新 1:我试过 npm install -g yarn 但仍然收到相同的错误消息。
更新: 我尝试在 cp-frontend 中将 tailwind.js 重命名为 tailwind.config.js,它也在 package.json 中引用。 Npm 启动有错误:
Failed to compile layout.js. Module not found can’t resolve react.router
我做了以下事情:
在根目录和 cp 前端目录中:
npm install react-router-dom
npm install react-router-config
在那之后我没有收到弹出错误,但有错误:
[frontend] Line 21:6: React Hook useEffect has a missing dependency: 'register'. Either include it or remove the dependency array react-hooks/exhaustive-deps
[frontend]
[frontend] ./src/components/user/findProperty/FindProperty.js
[frontend] Line 47:6: React Hook useEffect has a missing dependency: 'register'. Either include it or remove the dependency array react-hooks/exhaustive-deps
[frontend]
[frontend] ./src/components/user/dashboard/PastPayments.js
[frontend] Line 4:8: 'ChevronIcon' is defined but never used no-unused-vars
[frontend] Line 5:8: 'DownloadIcon' is defined but never used no-unused-vars
[frontend]
[frontend] ./src/components/common/alerts/Alerts.js
[frontend] Line 54:6: React Hook useEffect has an unnecessary dependency: 'fetchAlertData'. Either exclude it or remove the dependency array. Outer scope values like 'fetchAlertData' aren't valid dependencies because mutating them doesn't re-render the component react-hooks/exhaustive-deps
[frontend]
[frontend] ./src/components/user/pastBills/PastBills.js
[frontend] Line 66:6: React Hook useEffect has missing dependencies: 'history', 'params', 'serviceAccounts', and 'showFileInUrl'. Either include them or remove the dependency array react-hooks/exhaustive-deps
[frontend] Line 93:11: <iframe> elements must have a unique title property jsx-a11y/iframe-has-title
[frontend]
[frontend] ./src/components/user/dashboard/CustomerSvcTable.js
[frontend] Line 7:22: 'formatCurrencyNum' is defined but never used no-unused-vars
[frontend] Line 34:6: React Hook useEffect has a missing dependency: 'getSvcOrder'. Either include it or remove the dependency array react-hooks/exhaustive-deps
[frontend]
[frontend] ./src/components/user/layout/Layout.js
[frontend] Line 80:6: React Hook useEffect has a missing dependency: 'fetchInitialData'. Either include it or remove the dependency array react-hooks/exhaustive-deps
[frontend] Line 86:20: 'Tawk_API' was used before it was defined no-use-before-define
[frontend] Line 91:9: 'Tawk_LoadStart' is assigned a value but never used no-unused-vars
[frontend]
[frontend] ./src/components/common/navbar/Navbar.js
[frontend] Line 91:15: No duplicate props allowed react/jsx-no-duplicate-props
[frontend]
[frontend] ./src/components/common/card/Card.js
[frontend] Line 94:21: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
[frontend]
[frontend] Search for the keywords to learn more about each warning.
[frontend] To ignore, add // eslint-disable-next-line to the line before.
我现在的问题是,我是否需要将缺少的依赖项添加到前端的 package.json 中?我确定如果我执行 npm install 它们会消失,但我不清楚永久性修复。依赖列表项是否有顺序?浏览器弹出空白屏幕,但调试工具没有显示我能看到的错误。
tailwind-js-popup-error-800a0404- 之后消失了 在 cp-frontend 中将 tailwind.js 重命名为 tailwind.config.js 并且在 package.json 中引用它。 Npm 启动有错误:
编译失败layout.js。找不到模块无法解析 react.router 我做了以下事情:
在根目录和 cp 前端目录中:
npm 安装 react-router-dom npm 安装 react-router-config
在我将 link 移动到 Edge 而不是 IE 后,黑屏和错误消息消失了。