not found error occurred when running yarn build


Hi I am using html landing page of demo55 in symfony6 with webpack encore. When I tried to run yarn build command, it kept saying "./asserts/plugins.bundle.js" contains a reference to the file './locale', this file cannot be found.

and I have checked the demo55 folder, and cannot find this ./locale file anywhere inside the folder.

Where is this file located?


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (7)


Hi,

It appears that the issue is specific to the demo55 HTML version. Could you please provide details on any custom code you have included in your project? This will help us understand if the error is related to your modifications or if it is a problem within the original demo55 JS file.

Are you able to run from the demo55 html version? Does it has the issue with the missing /locale folder?

Thank you.



I can see the static landing page from demo55. it happens only when I run this yarn build from a symfony6 project.

Only I did was to copy mandatory js, css and fonts into symfony asserts folder and import mandatory js and css for all pages into app.js

// app.js
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/

// any CSS you import will output into a single css file (app.css in this case)
import './styles/app.css';
import './styles/plugins.bundle.css';
import './styles/style.bundle.css';

// start the Stimulus application
import './bootstrap';
import './plugins.bundle';
import './scripts.bundle';
(this is only thing I added)

and then run yarn build. it complains about './locale' not found. and I checked the plugins.bundle.js by searching './locale' and found that it was used inside, but nothing found outside folder structrue.

this symfony6 project is a brand new empty symfony project and created via symfony cli command 'symfony new my_project version="6.3.*" --webapp'.



Hi Tao,

Maybe the problem is that you are adding the plugins.bundle.js file as an entry in your webpack.config.js file, but this file is already bundled by webpack. Could you please try to addEntry with this file instead?

/tools/webpack/plugins/plugins.js

This file contains the original plugins that are not bundled yet. Maybe this will solve the errors. Let me know if it works.

Thanks



I solved this by adding an empty locale folder inside assets folder



I’m glad you solved it. We will check further on this issue. Feel free to let us know if you any question.

Thanks



not sure why the js wants to find this folder, but at least there should be an empty check there for what if this locale folder doesn't exist



It seems like this issue is caused by the moment plugin, which is used by plugins.bundle.js.

You can try some of the solutions suggested in these links:

-https://github.com/moment/moment/issues/2979
- https://stackoverflow.com/questions/25384360/how-to-prevent-moment-js-from-loading-locales-with-webpack
- https://github.com/webpack-contrib/moment-locales-webpack-plugin

They suggest using a plugin or a configuration option to ignore or remove the locale files from moment.js

We are working on fixing this issue in our future updates. Thank you for your feedback and patience.

Thanks


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

React Dev Vacancy

KeenThemes is looking for a Junior React or Vue developer to build awesome apps.
Apply
keenthemes mega bundle