1
1

Курс "Создание административной панели на React JS + PHP", урок 1.4

После создания функции getPageList() и применения её в обработчике события, при запуске gulp не собирается проект и пишет ошибку:

[10:49:27] 'build-js' errored after 3.93 s
[10:49:27] Error in plugin "webpack-stream"

в конце выдает:

[10:49:27] 'build' errored after 4.02 s
[10:49:27] 'default' errored after 4.03 s

Перерыл интернет, там написано что webpack-stream может просить старую версию webpack1, но настроить мне не удается.

Переустанавливал несколько раз webpack, webpack-stream, не помогает.

Вот полный log при запуске gulp:

PS E:\MAMP\htdocs\project> gulp
[10:49:23] Using gulpfile E:\MAMP\htdocs\project\gulpfile.js
[10:49:23] Starting 'default'...
[10:49:23] Starting 'watch'...
[10:49:23] Starting 'build'...
[10:49:23] Starting 'copy-html'...
[10:49:23] Starting 'copy-assets'...
[10:49:23] Starting 'copy-api'...
[10:49:23] Starting 'build-sass'...
[10:49:23] Starting 'build-js'...
[10:49:23] Finished 'copy-assets' after 531 ms
[10:49:24] Finished 'copy-html' after 914 ms
[10:49:24] Finished 'build-sass' after 934 ms
[10:49:24] Finished 'copy-api' after 975 ms
@babel/preset-env: `DEBUG` option

Using targets:
{}

Using modules transform: auto

Using plugins:
proposal-numeric-separator { }
proposal-logical-assignment-operators { }
proposal-nullish-coalescing-operator { }
proposal-optional-chaining { }
proposal-json-strings { }
proposal-optional-catch-binding { }
transform-parameters { }
proposal-async-generator-functions { }
proposal-object-rest-spread { }
transform-dotall-regex { }
proposal-unicode-property-regex { }
transform-named-capturing-groups-regex { }
transform-async-to-generator { }
transform-exponentiation-operator { }
transform-template-literals { }
transform-literals { }
transform-function-name { }
transform-arrow-functions { }
transform-block-scoped-functions { }
transform-classes { }
transform-object-super { }
transform-shorthand-properties { }
transform-duplicate-keys { }
transform-computed-properties { }
transform-for-of { }
transform-sticky-regex { }
transform-unicode-escapes { }
transform-unicode-regex { }
transform-spread { }
transform-destructuring { }
transform-block-scoping { }
transform-typeof-symbol { }
transform-new-target { }
transform-regenerator { }
transform-member-expression-literals { }
transform-property-literals { }
transform-reserved-words { }
proposal-export-namespace-from { }
syntax-dynamic-import
syntax-top-level-await
corejs3: `DEBUG` option

Using targets: {}

Using polyfills with `usage-global` method:
regenerator: `DEBUG` option

Using targets: {}

Using polyfills with `usage-global` method:

[E:\MAMP\htdocs\project\app\src\main.js]
The corejs3 polyfill added the following polyfills:
es.array.for-each {}
web.dom-collections.for-each {}

[E:\MAMP\htdocs\project\app\src\main.js]
Based on your code and targets, the regenerator polyfill did not add any polyfill.
[10:49:27] 'build-js' errored after 3.93 s
[10:49:27] Error in plugin "webpack-stream"
Message:
./app/src/main.js
Module not found: Error: Can't resolve 'core-js/fn/reflect' in 'E:\MAMP\htdocs\project\app\src'
resolve 'core-js/fn/reflect' in 'E:\MAMP\htdocs\project\app\src'
Parsed request is a module
using description file: E:\MAMP\htdocs\project\package.json (relative path: ./app/src)
Field 'browser' doesn't contain a valid alias configuration
resolve as module
E:\MAMP\htdocs\project\app\src\node_modules doesn't exist or is not a directory
E:\MAMP\htdocs\project\app\node_modules doesn't exist or is not a directory
E:\MAMP\htdocs\node_modules doesn't exist or is not a directory
E:\MAMP\node_modules doesn't exist or is not a directory
E:\node_modules doesn't exist or is not a directory
looking for modules in E:\MAMP\htdocs\project\node_modules
using description file: E:\MAMP\htdocs\project\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
using description file: E:\MAMP\htdocs\project\node_modules\core-js\package.json (relative path: ./fn/reflect)
no extension
Field 'browser' doesn't contain a valid alias configuration
E:\MAMP\htdocs\project\node_modules\core-js\fn\reflect doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
E:\MAMP\htdocs\project\node_modules\core-js\fn\reflect.wasm doesn't exist
.mjs
Field 'browser' doesn't contain a valid alias configuration
E:\MAMP\htdocs\project\node_modules\core-js\fn\reflect.mjs doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
E:\MAMP\htdocs\project\node_modules\core-js\fn\reflect.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
E:\MAMP\htdocs\project\node_modules\core-js\fn\reflect.json doesn't exist
as directory
E:\MAMP\htdocs\project\node_modules\core-js\fn\reflect doesn't exist
[E:\MAMP\htdocs\project\app\src\node_modules]
[E:\MAMP\htdocs\project\app\node_modules]
[E:\MAMP\htdocs\node_modules]
[E:\MAMP\node_modules]
[E:\node_modules]
[E:\MAMP\htdocs\project\node_modules\core-js\fn\reflect]
[E:\MAMP\htdocs\project\node_modules\core-js\fn\reflect.wasm]
[E:\MAMP\htdocs\project\node_modules\core-js\fn\reflect.mjs]
[E:\MAMP\htdocs\project\node_modules\core-js\fn\reflect.js]
[E:\MAMP\htdocs\project\node_modules\core-js\fn\reflect.json]
@ ./app/src/main.js 3:0-41
Details:
domainThrown: true

[10:49:27] 'build' errored after 4.02 s
[10:49:27] 'default' errored after 4.03 s


Александр Казимиров
3 years ago






Добрый день. Судя по всему, проблема именно в пакете:

Module not found: Error: Can't resolve 'core-js/fn/reflect'

Что можно попробовать:

- переустановите библиотеку core-js. Или можно попробовать просто обновить. Все команды вот тут: https://habr.com/ru/post/133363/

- Судя по логам, вы собираете проект прямо на сервере? Если да, то попробуйте собрать вне сервера. Может помочь за счет того, что сборка обращается к глобальным модулям, которые могут быть не на диске Е

Иван Петриченко
3 years ago

Один ответ