Javascript babel core js类型化数组构造函数:找不到模块'/内部构件/偏移量';
我在尝试使用core js时遇到此错误:Javascript babel core js类型化数组构造函数:找不到模块'/内部构件/偏移量';,javascript,babeljs,Javascript,Babeljs,我在尝试使用core js时遇到此错误: typed-array-constructor.js:13 Uncaught Error: Cannot find module '../internals/to-offset' at webpackMissingModule (typed-array-constructor.js:13) 我在node modules/core js包中搜索了这个文件,它就在那里(两次:在core js和core js pure包中。还有一个core js c
typed-array-constructor.js:13 Uncaught Error: Cannot find module '../internals/to-offset'
at webpackMissingModule (typed-array-constructor.js:13)
我在node modules/core js包中搜索了这个文件,它就在那里(两次:在core js和core js pure包中。还有一个core js compact,我不知道它为什么在那里)
但是当我检查浏览器调试器时,它似乎正在加载“core js”,并且在预期的文件夹中没有所需文件的证据!我应该手工输入,还是这里缺少什么
我的.法律改革委员会:
{
"presets": [
["@babel/preset-env", {
useBuiltIns: "usage", // or "entry"
corejs: { version: '3.6', proposals: false }
}],
"@babel/preset-react"
],
"plugins": []
}
my index.js:
import 'core-js/stable';
import 'regenerator-runtime/runtime';
require('./app');
my webpack.config.js:
const path = require('path');
module.exports = {
entry: './src/app.js', // relative path
output: {
path: path.join(__dirname, 'public'), // absolute path
filename: 'bundle.js' // file name
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
}
};
..和包json:
{
"name": "client",
"version": "1.0.0",
"description": "",
"private": true,
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "webpack --watch",
"build": "webpack",
"start": "webpack-dev-server --open",
"assets": "cp -r ../assets ~/s3/local-medialibrary"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/preset-env": "^7.10.2",
"@babel/preset-react": "^7.10.1",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^1.7.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"regenerator-runtime": "^0.13.5",
"@babel/core": "^7.10.2",
"@babel/plugin-transform-runtime": "^7.10.1",
"@babel/runtime-corejs3": "^7.10.2",
"ammo.js": "github:kripken/ammo.js",
"babel-loader": "^8.1.0",
"core-js": "^3.6.5",
"dat.gui": "^0.7.6",
"pathfinding": "^0.4.18",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"stats.js": "^0.17.0",
"three": "^0.114.0"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
哼。。我并没有真正找到一个解决方案,但找到了一个暂时的解决办法:如果我从index.js中注释掉核心js,它就可以工作了。我知道core js的功能是注入polyfills,所以我非常感兴趣的是发现这些选项中的一些是否可行(以及如何实现):1。保留核心js,但排除类型化数组polyfills。。2.强制core js包含那些似乎从捆绑包中误传的类型化数组多边形填充。显然,我们是唯一遇到这个问题的两个人。哼。。我并没有真正找到一个解决方案,但找到了一个暂时的解决办法:如果我从index.js中注释掉核心js,它就可以工作了。我知道core js的功能是注入polyfills,所以我非常感兴趣的是发现这些选项中的一些是否可行(以及如何实现):1。保留核心js,但排除类型化数组polyfills。。2.强制core js包含那些类型化数组的多边形填充,这些填充似乎是从捆绑包中误传出来的。显然,我们是唯一遇到这个问题的两个人。