Skip to content

Lerna failed task: @strapi/admin:build #14982

@LB22

Description

@LB22

Bug report

Required System information

  • Node.js version: 18.9.0
  • NPM version: 8.9.1
  • Yarn version: 1.22.19
  • Strapi version: Latest
  • Database: N/A
  • Operating system: Windows 10

Describe the bug

I'm following the Strapi contributing guide and I get stuck on point 3, installing the dependencies with yarn setup.

PS C:\Users\Ludvig\Documents\Programming\strapi> yarn setup
yarn run v1.22.19
$ yarn && yarn build
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > @strapi/[email protected]" has unmet peer dependency "redux@^4.0.1".
warning " > @strapi/[email protected]" has unmet peer dependency "webpack@^5.74.0".
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
[5/5] Building fresh packages...
$ husky install
husky - Git hooks installed
$ lerna run --stream build --no-private
lerna notice cli v5.4.3

 >  Lerna (powered by Nx)   Running target build for 2 project(s):

    - @strapi/admin
    - @strapi/helper-plugin

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

> @strapi/helper-plugin:build

$ rimraf build    [...elper-plugin] 
[...elper-plugin] $ yarn build:development && yarn build:production && yarn create:index
[...elper-plugin] $ cross-env NODE_ENV=development webpack-cli
[...elper-plugin] asset helper-plugin.development.js 819 KiB [emitted] (name: main)     
[...elper-plugin] runtime modules 937 bytes 4 modules
[...elper-plugin] cacheable modules 184 KiB
[...elper-plugin]   modules by path ./lib/src/ 155 KiB 101 modules
[...elper-plugin]   modules by path ../../../node_modules/ 28.9 KiB 8 modules
[...elper-plugin] modules by path external "@strapi/ 1.72 KiB
[...elper-plugin]   modules by path external "@strapi/design-system/ 1.23 KiB 30 modules
[...elper-plugin]   modules by path external "@strapi/icons/ 504 bytes 12 modules
[...elper-plugin] modules by path external "lodash/ 294 bytes
[...elper-plugin]   external "lodash/get" 42 bytes [built] [code generated]
[...elper-plugin]   external "lodash/startsWith" 42 bytes [built] [code generated]
[...elper-plugin]   + 5 modules
[...elper-plugin] modules by path external "date-fns/ 84 bytes
[...elper-plugin]   external "date-fns/parseISO" 42 bytes [built] [code generated]
[...elper-plugin]   external "date-fns/formatISO" 42 bytes [built] [code generated]
[...elper-plugin] + 13 modules
[...elper-plugin] webpack 5.74.0 compiled successfully in 541 ms
[...elper-plugin] $ cross-env NODE_ENV=production webpack-cli
[...elper-plugin] asset helper-plugin.production.js 82.4 KiB [emitted] [minimized] (name: main)
[...elper-plugin] orphan modules 149 KiB [orphan] 100 modules
[...elper-plugin] runtime modules 937 bytes 4 modules
[...elper-plugin] built modules 159 KiB [built]
[...elper-plugin]   modules by path external "@strapi/ 1.72 KiB 42 modules
[...elper-plugin]   modules by path external "lodash/ 294 bytes
[...elper-plugin]     external "lodash/get" 42 bytes [built] [code generated]
[...elper-plugin]     + 6 modules
[...elper-plugin]   cacheable modules 156 KiB
[...elper-plugin]     modules by path ../../../node_modules/prop-types/*.js 1.53 KiB 2 modules
[...elper-plugin]     + 2 modules
[...elper-plugin]   modules by path external "date-fns/ 84 bytes
[...elper-plugin]     external "date-fns/parseISO" 42 bytes [built] [code generated]
[...elper-plugin]     external "date-fns/formatISO" 42 bytes [built] [code generated]
[...elper-plugin]   + 13 modules
[...elper-plugin] webpack 5.74.0 compiled successfully in 690 ms
$ node ./createBuildIndex.jsplugin]

> @strapi/admin:build

[@strapi/admin  ] $ rimraf build && node ./scripts/build.js
[@strapi/admin  ] Building the admin panel
[@strapi/admin  ] i Compiling Webpack
[@strapi/admin  ] √ Webpack: Compiled with some errors in 22.02s
[@strapi/admin  ] Error: Module parse failed: Unexpected token (10:25)
[@strapi/admin  ] You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
[@strapi/admin  ] | import Layout from '@strapi/icons/Layout';
[@strapi/admin  ] |
[@strapi/admin  ] > const PluginIcon = () => <Layout />;
[@strapi/admin  ] |
[@strapi/admin  ] | export default PluginIcon;
[@strapi/admin  ]     at C:\Users\Ludvig\Documents\Programming\strapi\packages\core\admin\scripts\build.js:91:11
[@strapi/admin  ]     at finalCallback (C:\Users\Ludvig\Documents\Programming\strapi\node_modules\webpack\lib\Compiler.js:441:32)
[@strapi/admin  ]     at C:\Users\Ludvig\Documents\Programming\strapi\node_modules\webpack\lib\Compiler.js:458:13
[@strapi/admin  ]     at Hook.eval [as callAsync] (eval at create (C:\Users\Ludvig\Documents\Programming\strapi\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:35:1)
[@strapi/admin  ]     at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\Users\Ludvig\Documents\Programming\strapi\node_modules\webpack\node_modules\tapable\lib\Hook.js:18:14)
[@strapi/admin  ]     at onCompiled (C:\Users\Ludvig\Documents\Programming\strapi\node_modules\webpack\lib\Compiler.js:456:21)
[@strapi/admin  ]     at C:\Users\Ludvig\Documents\Programming\strapi\node_modules\webpack\lib\Compiler.js:1196:17
[@strapi/admin  ]     at eval (eval at create (C:\Users\Ludvig\Documents\Programming\strapi\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:14:1)
[@strapi/admin  ]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
error Command failed with exit code 1.strapi/admin  ]
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

 ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————      

 >  Lerna (powered by Nx)   Running target "build" failed

   Failed tasks:

   - @strapi/admin:build

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to reproduce the behavior

  1. Fork https://github.com/strapi/strapi/
  2. Clone it and run yarn setup in root of strapi folder
  3. See error

Screenshots

Strapi-build-error

Metadata

Metadata

Assignees

Labels

issue: bugIssue reporting a bugseverity: highIf it breaks the basic use of the productsource: core:adminSource is core/admin packagestatus: confirmedConfirmed by a Strapi Team member or multiple community members

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions