core-js无法解析core-js / modules / es6.typed.uint32-array

问题描述

最近,我在某些依赖开发环境的Gatsby React应用中将C ++ Emscripten生成的javascript模块包含到Gatsby React应用中的过程中,在Webpack阶段找不到core-js/modules/es6.typed.uint32-array的以下错误中,我努力寻找解决方案。 >

以下是示例错误,可简化Google的操作:

 ERROR #98124  WEBPACK

Generating development JavaScript bundle Failed

Can't resolve 'core-js/modules/es6.typed.uint32-array' in

    ERROR #98124  WEBPACK

Can't resolve 'core-js/modules/es6.typed.float32-array' in '/Users/tk/gitrepos/windfall8/src/library'

If you're trying to use a package make sure that 'core-js/modules/es6.typed.float32-array' is installed. If you're trying to use a local file make sure that the path is correct.

 ERROR #98124  WEBPACK

Can't resolve 'core-js/modules/es6.typed.float64-array' in '/Users/tk/gitrepos/windfall8/src/library'

If you're trying to use a package make sure that 'core-js/modules/es6.typed.float64-array' is installed. If you're trying to use a local file make sure that the path is correct.

 ERROR #98124  WEBPACK

Can't resolve 'core-js/modules/es6.typed.int16-array' in '/Users/tk/gitrepos/windfall8/src/library'

If you're trying to use a package make sure that 'core-js/modules/es6.typed.int16-array' is installed. If you're trying to use a local file make sure that the path is correct.

 ERROR #98124  WEBPACK

Can't resolve 'core-js/modules/es6.typed.int32-array' in '/Users/tk/gitrepos/windfall8/src/library'

If you're trying to use a package make sure that 'core-js/modules/es6.typed.int32-array' is installed. If you're trying to use a local file make sure that the path is correct.

 ERROR #98124  WEBPACK

Can't resolve 'core-js/modules/es6.typed.int8-array' in '/Users/tk/gitrepos/windfall8/src/library'

If you're trying to use a package make sure that 'core-js/modules/es6.typed.int8-array' is installed. If you're trying to use a local file make sure that the path is correct.

File: src/library/anypiajs.mjs

 ERROR #98124  WEBPACK

Can't resolve 'core-js/modules/es6.typed.uint16-array' in '/Users/tk/gitrepos/windfall8/src/library'

If you're trying to use a package make sure that 'core-js/modules/es6.typed.uint16-array' is installed. If you're trying to use a local file make sure that the path is correct.

 ERROR #98124  WEBPACK

Generating development JavaScript bundle Failed

Can't resolve 'core-js/modules/es6.typed.uint32-array' in '/Users/tk/gitrepos/windfall8/src/library'

If you're trying to use a package make sure that 'core-js/modules/es6.typed.uint32-array' is installed. If you're trying to use a local file make sure that the path is correct.

 ERROR #98124  WEBPACK

Can't resolve 'core-js/modules/es6.typed.uint8-array' in '/Users/tk/gitrepos/windfall8/src/library'

If you're trying to use a package make sure that 'core-js/modules/es6.typed.uint8-array' is installed. If you're trying to use a local file make sure that the path is correct.

 ERROR #98124  WEBPACK

Can't resolve 'core-js/modules/es6.typed.uint8-clamped-array' in '/Users/tk/gitrepos/windfall8/src/library'

If you're trying to use a package make sure that 'core-js/modules/es6.typed.uint8-clamped-array' is installed. If you're trying to use a local file make sure that the path is correct.

解决方法

事实证明,核心js最近将.typed.的部分从原来的.typed-array.更改为core-js/modules/es6.typed.int8-array。我只需要在生成的emscripten模块中明确包含这些调整后的路径即可。

我也npm i core-js@3,但是我没有测试是否需要。不需要特殊的babelrc配置:

import 'core-js/modules/es6.typed-array.float32-array';
import 'core-js/modules/es6.typed-array.float64-array';
import 'core-js/modules/es6.typed-array.int16-array';
import 'core-js/modules/es6.typed-array.int32-array';
import 'core-js/modules/es6.typed-array.int8-array';
import 'core-js/modules/es6.typed-array.uint16-array';
import 'core-js/modules/es6.typed-array.uint32-array';
import 'core-js/modules/es6.typed-array.uint8-array';
import 'core-js/modules/es6.typed-array.uint8-clamped-array';