Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.1.6 form extensions error when running webpack #10247

Closed
liamjtoohey opened this issue Jun 18, 2019 · 8 comments
Closed

3.1.6 form extensions error when running webpack #10247

liamjtoohey opened this issue Jun 18, 2019 · 8 comments
Labels

Comments

@liamjtoohey
Copy link

liamjtoohey commented Jun 18, 2019

Description

I am experiencing an error when running webpack after installing Akeneo 3.1.6 CE manually. Version information below:

operating system: MacOSX

php: 7.2.13
node: v10.16.0
yarn: 1.16.0
mysql: 5.7

The error:

$ yarn run webpack
yarn run v1.16.0
$ yarn requirements && NODE_PATH=node_modules webpack --config $npm_package_config_source/webpack.config.js
$ node $npm_package_config_source/frontend/build/check-requirements.js
Checking PIM frontend requirements
Starting webpack from /Users/liamtoohey/src/project-akeneo in dev mode
Executing pre-build scripts
(node:19219) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
$ node $npm_package_config_source/frontend/build/update-extensions.js
$ node $npm_package_config_styles
Updating form extensions.json
/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/frontend/build/update-extensions.js:76
    const mergedExtensions = Object.entries(merged.extensions).map(([code, extension]) => {
                                    ^

TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at mergeExtensions (/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/frontend/build/update-extensions.js:76:37)
    at Object.<anonymous> (/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/frontend/build/update-extensions.js:110:26)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

/Users/liamtoohey/src/project-akeneo/node_modules/webpack-shell-plugin/lib/index.js:168
        throw error;
        ^
1

It appears that the form extensions are missing? I am struggling to debug this as I have a vanilla instance with no custom code. In regards to FE build steps I have ran, I have been following the guide here https://docs.akeneo.com/3.1/install_pim/docker/installation_docker.html

The install command completed with no issues, DB looks good also. I have not been able to replicate this error when setting up via docker which seems strange.

@Doodoune
Copy link
Contributor

Doodoune commented Jun 18, 2019

Hi! Can you say at which step do you have this error? (or on which command?)
Which system do you using? (docker or another?)

@liamjtoohey
Copy link
Author

liamjtoohey commented Jun 19, 2019

Hi @Doodoune ! I am setting up this project locally using MacOSX. My local setup is similar to MAMP however I am using brew to manage PHP/yarn/node etc. I am getting this error when running yarn run webpack as specified here https://docs.akeneo.com/3.1/install_pim/manual/installation_ce_archive.html#initializing-akeneo

Looking at the changes made in this PR #9607 it appears that node is not dumping any data to /js/extensions.json - presumably related to the error. Commands like yarn install are running fine for me however - am I missing a step?

@liamjtoohey
Copy link
Author

liamjtoohey commented Jun 19, 2019

@Doodoune Got an interesting update. There appears to be a bug in the following regex commands:

My akeneo project currently lives in a src directory. The error I am experiencing seems to be due to incorrect filepaths being read from web/js/require-paths.js. An example of my web/js/require-paths.js contents:

module.exports = ["/Users/liamtoohey/src/project-akeneo/vendor/doctrine/doctrine-bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/doctrine/doctrine-cache-bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/sensio/framework-extra-bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/symfony/monolog-bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/symfony/swiftmailer-bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/doctrine/doctrine-fixtures-bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/friendsofsymfony/jsrouting-bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/friendsofsymfony/rest-bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/liip/imagine-bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Oro/Bundle/ConfigBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Oro/Bundle/DataGridBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Oro/Bundle/FilterBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Oro/Bundle/SecurityBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Oro/Bundle/TranslationBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Tool/Bundle/ConnectorBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Tool/Bundle/ClassificationBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Tool/Bundle/VersioningBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Tool/Bundle/ElasticsearchBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Tool/Bundle/BatchBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Tool/Bundle/BatchQueueBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Tool/Bundle/BufferBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Tool/Bundle/FileStorageBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Tool/Bundle/MeasureBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Tool/Bundle/StorageUtilsBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/doctrine/doctrine-migrations-bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/friendsofsymfony/oauth-server-bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Tool/Bundle/ApiBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/oneup/flysystem-bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Oro/Bundle/PimFilterBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Oro/Bundle/PimDataGridBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/UserManagement/Bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Channel/Bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Pim/Enrichment/Bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Pim/Structure/Bundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/DashboardBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/AnalyticsBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/ImportExportBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/InstallerBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/NotificationBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/UIBundle",
"/Users/liamtoohey/src/project-akeneo/vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/CatalogVolumeMonitoringBundle"]

As you can see, the project lives in /Users/liamtoohey/src. This seems to cause issues with the regex command linked earlier as this command only removes characters up to the first src string, which in this case is not the src directory within Akeneo - but my working directory. Some examples can be found here: https://regex101.com/r/8GRLUq/1

Due to this, the filepaths in the dir variable here https://github.com/akeneo/pim-community-dev/blob/v3.1.6/frontend/build/update-extensions.js#L60 look like

...
src/project-akeneo/vendor/akeneo/pim-community-dev/src/Oro/Bundle/ConfigBundle
src/project-akeneo/vendor/akeneo/pim-community-dev/src/Oro/Bundle/DataGridBundle
src/project-akeneo/vendor/akeneo/pim-community-dev/src/Oro/Bundle/FilterBundle
src/project-akeneo/vendor/akeneo/pim-community-dev/src/Oro/Bundle/SecurityBundle
src/project-akeneo/vendor/akeneo/pim-community-dev/src/Oro/Bundle/TranslationBundle
...

When they should look like:

...
/Users/liamtoohey/src/vendor/akeneo/pim-community-dev/src/Oro/Bundle/ConfigBundle
/Users/liamtoohey/src/vendor/akeneo/pim-community-dev/src/Oro/Bundle/DataGridBundle
/Users/liamtoohey/src/vendor/akeneo/pim-community-dev/src/Oro/Bundle/FilterBundle
/Users/liamtoohey/src/vendor/akeneo/pim-community-dev/src/Oro/Bundle/SecurityBundle
/Users/liamtoohey/src/vendor/akeneo/pim-community-dev/src/Oro/Bundle/TranslationBundle
...

@liamjtoohey liamjtoohey changed the title 3.1.16 form extensions error when running webpack 3.1.6 form extensions error when running webpack Jun 21, 2019
@liamjtoohey
Copy link
Author

@Doodoune Any update on this? I've raised a PR to amend the regex causing this issue 🙂

@Dejmon
Copy link

Dejmon commented Aug 2, 2019

I have the same issue. I made package (installed from composer) that have src/ directory and inside form_extensions. Those extensions aren't loaded because of this regex in update-extensions.js. Could you fix it? It might that
@liamjtoohey fix this regex and is enough to accept his PR.

@lenvanessen
Copy link

Broken on 3.2 as well

@tamarasaurus
Copy link
Contributor

@liamjtoohey Hey, your contribution has been merged to master here: #10568 thanks again!

@duckchip
Copy link

@tamarasaurus Shouldn't this issue should be back-ported in Akeneo 3.2 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants