Saleor: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag

Created on 13 Feb 2019  路  8Comments  路  Source: mirumee/saleor

What I'm trying to achieve

While following the installation instructions when running npm run build-assets i run into the following error:

Ouput

(venv-saleor) alicia@staging:~/saleor$ npm run build-assets

[email protected] build-assets /home/alicia/saleor
webpack -p

Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
(node:87054) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
Hash: 5a40c357659cbb67f2f6
Version: webpack 4.29.3
Time: 34443ms
Built at: 02/13/2019 12:38:19 PM
                                                  Asset        Size  Chunks                    Chunk Names
       Lato-Bold.061b572d02df38e00fc9978034ac09b8.woff2    28.1 KiB          [emitted]
         Lato-Bold.44dfe8cc676882243911a3197a50169e.ttf     119 KiB          [emitted]
        Lato-Bold.d0549ba90a0800d86d585f1e63df52b3.woff    36.1 KiB          [emitted]
       Lato-Light.067d56d83ba6202f296c6acd0fd107b1.woff    34.9 KiB          [emitted]
        Lato-Light.5b761f2d1e4259ea6ac7ab3ebf7f3c49.ttf     120 KiB          [emitted]
      Lato-Light.96b78ec9be61a9b1e91d455627636d53.woff2    31.6 KiB          [emitted]
     Lato-Regular.01f09144fb08c2185c04b46601a6894d.woff    36.9 KiB          [emitted]
    Lato-Regular.183bf2570509b4588f48227a1799c1bc.woff2    28.6 KiB          [emitted]
      Lato-Regular.7f690e503a254e0b8349aec0177e07aa.ttf     117 KiB          [emitted]
     Roboto-Bold.c0f1e4a4fdfb8048c72e86aadb2a247d.woff2    63.3 KiB          [emitted]
      Roboto-Bold.eed9aab5449cc9c8430d7d258108f602.woff    88.2 KiB          [emitted]
    Roboto-Light.3c37aa69cd77e6a53a067170fa8fe2e9.woff2    62.8 KiB          [emitted]
     Roboto-Light.ea36cd9a0e9eee97012a67b8a4570d7b.woff    87.6 KiB          [emitted]
   Roboto-Medium.1561b424aaef2f704bbd89155b3ce514.woff2    63.9 KiB          [emitted]
    Roboto-Medium.cf4d60bc0b1d4b2314085919a00e1724.woff    88.4 KiB          [emitted]
   Roboto-Regular.3cf6adf61054c328b1b0ddcd8f9ce24d.woff    87.7 KiB          [emitted]
  Roboto-Regular.5136cbe62a63604402f2fedb97f246f8.woff2    63.3 KiB          [emitted]
     Roboto-Thin.1f35e6a11d27d2e10d28946d42332dc5.woff2    61.6 KiB          [emitted]
      Roboto-Thin.44b78f142603eb69f593ed4002ed7a4a.woff    86.1 KiB          [emitted]
      align_center.261490e2a4abf6925c5e533cacef7361.svg   239 bytes          [emitted]
     align_justify.2eecf9cbf6e5c9260e4c366e1f2b49b1.svg   238 bytes          [emitted]
        align_left.ab9f0ff87e27ff7b6a58106c012daf22.svg   240 bytes          [emitted]
       align_right.b45aa1ea0df06c6a9506b0cd3e8527fe.svg   239 bytes          [emitted]
      arrow-select.cf30a11fd56d142d7630b56f16fb0f65.svg   571 bytes          [emitted]
            block1.b6fb939e413b8a23addbde6341ce6b56.jpg     260 KiB          [emitted]  [big]
            block2.781788024131717ff285b55c9b65bc9b.jpg     193 KiB          [emitted]
            block3.32b6cc89f5782d49fcea30e7b50ef506.jpg     131 KiB          [emitted]
     chevron-right.b90a94d3bf483b8d97e4647049ecdaa2.svg   210 bytes          [emitted]
             close.ec0a5fedbc923f0763a1886366f4967c.svg   266 bytes          [emitted]
                 dashboard-next.573cbe70500f7cd6ed2f.js    2.59 MiB       1  [emitted]  [big]  dashboard-next
                     dashboard.c37abb2373b32e573a7b.css     224 KiB       0  [emitted]         dashboard
                      dashboard.c37abb2373b32e573a7b.js     541 KiB       0  [emitted]  [big]  dashboard
                      document.80fcbab7cc275a4f2938.css    2.52 KiB       2  [emitted]         document
                       document.80fcbab7cc275a4f2938.js  1010 bytes       2  [emitted]         document
              done.6469e271be639f7e5f1e45ffbb16c876.svg   215 bytes          [emitted]
      format_clear.9ea4294f9494325a0a198b0201443e63.svg   296 bytes          [emitted]
       insert_link.9523768776537a425ceaf093d2dddb00.svg   375 bytes          [emitted]
      insert_photo.497fe7788e4adeb99de29152704b8d32.svg   284 bytes          [emitted]
     logo-document.d493430f320751f6bffac210ced37643.svg     1.2 KiB          [emitted]
              logo.2221016e2995c10baa4ae61a10be6dad.svg    2.18 KiB          [emitted]
     not-found-404.a4d671be72e48d8ad9e8254297221171.svg    1.21 KiB          [emitted]
    pass-invisible.d5a74fda0ae925038d3d4a2b9cb030d3.svg    1.67 KiB          [emitted]
      pass-visible.d7d2a2f14d58c56691160e88464dfdb5.svg    1.24 KiB          [emitted]
placeholder255x255.bb658a475f01d6538c482fd852ad782c.png     4.6 KiB          [emitted]
             quote.a519f24a889ca0c8830dccdd93a810b4.svg   204 bytes          [emitted]
                    storefront.e77594530c4b7b30d367.css     163 KiB       3  [emitted]         storefront
                     storefront.e77594530c4b7b30d367.js     456 KiB       3  [emitted]  [big]  storefront
              what.b7ae116ae14cafe6adfb9cfa119599c5.svg    1.49 KiB          [emitted]
Entrypoint dashboard [big] = dashboard.c37abb2373b32e573a7b.css dashboard.c37abb2373b32e573a7b.js
Entrypoint dashboard-next [big] = dashboard-next.573cbe70500f7cd6ed2f.js
Entrypoint dashboard-next [big] = dashboard-next.573cbe70500f7cd6ed2f.js
Entrypoint document = document.80fcbab7cc275a4f2938.css document.80fcbab7cc275a4f2938.js
Entrypoint storefront [big] = storefront.e77594530c4b7b30d367.css storefront.e77594530c4b7b30d367.js
   [3] ./saleor/static/dashboard-next/i18n.ts 478 bytes {1} [built]
  [33] ./node_modules/apollo-link/lib/bundle.esm.js + 1 modules 8.53 KiB {1} [built]
       |    2 modules
  [43] ./node_modules/react-router-dom/es/index.js + 14 modules 14.1 KiB {1} [built]
       |    15 modules
  [45] ./saleor/static/dashboard-next/types/globalTypes.ts 6.36 KiB {1} [built]
 [101] ./saleor/static/dashboard-next/auth/index.tsx 716 bytes {1} [built]
 [242] ./saleor/static/dashboard-next/configuration/index.tsx 3.63 KiB {1} [built]
 [293] ./saleor/static/dashboard-next/index.tsx 8.29 KiB {1} [built]
 [341] ./saleor/static/dashboard-next/NotFound.tsx 476 bytes {1} [built]
 [343] ./saleor/static/dashboard-next/auth/misc.ts 227 bytes {1} [built]
 [655] ./saleor/static/dashboard-next/theme.ts 5.44 KiB {1} [built]
 [664] ./node_modules/apollo-client/index.js + 14 modules 86 KiB {1} [built]
       |    15 modules
 [693] ./saleor/static/dashboard/scss/dashboard.scss 39 bytes {0} [built]
[1321] ./saleor/static/dashboard/js/document.js 31 bytes {2} [built]
[1323] ./saleor/static/js/storefront.js 464 bytes {3} [built]
[1341] ./saleor/static/dashboard/js/dashboard.js + 1 modules 589 bytes {0} [built]
       | ./saleor/static/dashboard/js/dashboard.js 125 bytes [built]
       |     + 1 hidden module
    + 1338 hidden modules

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  block1.b6fb939e413b8a23addbde6341ce6b56.jpg (260 KiB)
  dashboard.c37abb2373b32e573a7b.js (541 KiB)
  dashboard-next.573cbe70500f7cd6ed2f.js (2.59 MiB)
  storefront.e77594530c4b7b30d367.js (456 KiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  dashboard (765 KiB)
      dashboard.c37abb2373b32e573a7b.css
      dashboard.c37abb2373b32e573a7b.js
  dashboard-next (2.59 MiB)
      dashboard-next.573cbe70500f7cd6ed2f.js
  storefront (619 KiB)
      storefront.e77594530c4b7b30d367.css
      storefront.e77594530c4b7b30d367.js


WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/categories/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/categories/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/categories/views/CategoryDetails/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/categories/views/CategoryDetails/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/collections/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/collections/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/customers/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/customers/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/mutations.tsx
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/mutations.tsx(49,11):
TS2322: Type 'TVariables' is not assignable to type 'IsExactlyAny extends true ? object : TVariables'.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/orders/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/orders/urls.ts(2,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/orders/views/OrderDetails/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/orders/views/OrderDetails/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/pages/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/pages/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/products/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/products/urls.ts(2,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/products/views/ProductImage/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/products/views/ProductImage/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/products/views/ProductUpdate/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/products/views/ProductUpdate/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/products/views/ProductVariant/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/products/views/ProductVariant/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/productTypes/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/productTypes/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/productTypes/views/ProductTypeUpdate/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/productTypes/views/ProductTypeUpdate/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/queries.tsx
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/queries.tsx(78,19):
TS2322: Type 'TVariables' is not assignable to type 'IsExactlyAny extends true ? object : TVariables'.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/siteSettings/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/siteSettings/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/staff/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/staff/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

ERROR in /home/alicia/saleor/saleor/static/dashboard-next/taxes/urls.ts
ERROR in /home/alicia/saleor/saleor/static/dashboard-next/taxes/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.
Child mini-css-extract-plugin node_modules/css-loader/index.js??ref--5-1!node_modules/postcss-loader/lib/index.js??ref--5-2!node_modules/sass-loader/lib/loader.js??ref--5-3!saleor/static/dashboard/scss/dashboard.scss:
    Entrypoint mini-css-extract-plugin = *
     [0] ./node_modules/css-loader??ref--5-1!./node_modules/postcss-loader/lib??ref--5-2!./node_modules/sass-loader/lib/loader.js??ref--5-3!./saleor/static/dashboard/scss/dashboard.scss 645 KiB {0} [built]
    [13] ./saleor/static/dashboard/images/chevron-right.svg 96 bytes {0} [built]
        + 12 hidden modules
Child mini-css-extract-plugin node_modules/css-loader/index.js??ref--5-1!node_modules/postcss-loader/lib/index.js??ref--5-2!node_modules/sass-loader/lib/loader.js??ref--5-3!saleor/static/dashboard/scss/document.scss:
    Entrypoint mini-css-extract-plugin = *
    [0] ./node_modules/css-loader??ref--5-1!./node_modules/postcss-loader/lib??ref--5-2!./node_modules/sass-loader/lib/loader.js??ref--5-3!./saleor/static/dashboard/scss/document.scss 7.11 KiB {0} [built]
        + 1 hidden module
Child mini-css-extract-plugin node_modules/css-loader/index.js??ref--5-1!node_modules/postcss-loader/lib/index.js??ref--5-2!node_modules/sass-loader/lib/loader.js??ref--5-3!saleor/static/scss/storefront.scss:
    Entrypoint mini-css-extract-plugin = *
     [0] ./node_modules/css-loader??ref--5-1!./node_modules/postcss-loader/lib??ref--5-2!./node_modules/sass-loader/lib/loader.js??ref--5-3!./saleor/static/scss/storefront.scss 463 KiB {0} [built]
     [3] ./saleor/static/images/arrow-select.svg 95 bytes {0} [built]
     [4] ./saleor/static/fonts/Lato-Light.woff2 95 bytes {0} [built]
     [5] ./saleor/static/fonts/Lato-Light.woff 94 bytes {0} [built]
     [6] ./saleor/static/fonts/Lato-Light.ttf 93 bytes {0} [built]
     [7] ./saleor/static/fonts/Lato-Regular.woff2 97 bytes {0} [built]
     [8] ./saleor/static/fonts/Lato-Regular.woff 96 bytes {0} [built]
     [9] ./saleor/static/fonts/Lato-Regular.ttf 95 bytes {0} [built]
    [10] ./saleor/static/fonts/Lato-Bold.woff2 94 bytes {0} [built]
    [11] ./saleor/static/fonts/Lato-Bold.woff 93 bytes {0} [built]
    [12] ./saleor/static/fonts/Lato-Bold.ttf 92 bytes {0} [built]
    [13] ./saleor/static/images/block1.jpg 89 bytes {0} [built]
    [14] ./saleor/static/images/block2.jpg 89 bytes {0} [built]
    [15] ./saleor/static/images/block3.jpg 89 bytes {0} [built]
        + 2 hidden modules

npm ERR! Linux 4.15.0-29-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "build-assets"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build-assets: `webpack -p`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build-assets script 'webpack -p'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the saleor package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:   
npm ERR!     webpack -p
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs saleor
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls saleor
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/alicia/saleor/npm-debug.log

The contents of /home/alicia/saleor/npm-debug.log is

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build-assets' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild-assets', 'build-assets', 'postbuild-assets' ]
5 info lifecycle [email protected]~prebuild-assets: [email protected]
6 silly lifecycle [email protected]~prebuild-assets: no script for prebuild-assets, continuing
7 info lifecycle [email protected]~build-assets: [email protected]
8 verbose lifecycle [email protected]~build-assets: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~build-assets: PATH: /usr/share/npm/bin/node-gyp-bin:/home/alicia/saleor/node_modules/.bin:/home/alicia/venv-saleor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
10 verbose lifecycle [email protected]~build-assets: CWD: /home/alicia/saleor
11 silly lifecycle [email protected]~build-assets: Args: [ '-c', 'webpack -p' ]
12 silly lifecycle [email protected]~build-assets: Returned: code: 2  signal: null
13 info lifecycle [email protected]~build-assets: Failed to exec build-assets script
14 verbose stack Error: [email protected] build-assets: `webpack -p`
14 verbose stack Exit status 2
14 verbose stack     at EventEmitter. (/usr/share/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack     at emitTwo (events.js:126:13)
14 verbose stack     at EventEmitter.emit (events.js:214:7)
14 verbose stack     at ChildProcess. (/usr/share/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:126:13)
14 verbose stack     at ChildProcess.emit (events.js:214:7)
14 verbose stack     at maybeClose (internal/child_process.js:925:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
15 verbose pkgid [email protected]
16 verbose cwd /home/alicia/saleor
17 error Linux 4.15.0-29-generic
18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "build-assets"
19 error node v8.10.0
20 error npm  v3.5.2
21 error code ELIFECYCLE
22 error [email protected] build-assets: `webpack -p`
22 error Exit status 2
23 error Failed at the [email protected] build-assets script 'webpack -p'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the saleor package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     webpack -p
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs saleor
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls saleor
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

System information
Operating system: Ubuntu 18.04

Most helpful comment

If you came here from google as I did...

Hello there :)

All 8 comments

From the log I see that you're using Node 8.x. Please upgrade to Node 10.x which is required by Saleor.

ugh.. thanks i'l give it a try.

thanks that worked!

with node 11.x djano 2.2 saleor march 2019 release
raise WebpackError(error)
webpack_loader.exceptions.WebpackError:
unknown-error in
ERROR in /home/asif/upwork/viets/saleor/static/dashboard-next/categories/urls.ts(1,26):
TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.

If you came here from google as I did. My solution was to be lazy.

Terminal :

ls and find your project folder
open . find package.json
find this...

"engines": { "node": ">=10.6.0", "npm": ">=6.1.0"
Remove >= on the version you want to use.

@auvipy Hi, I think we 're on the same issues. May You share us your solution here ?

@ch1ris23 Thank for your suggestion but I have tried but it does not apply with what the issue occur. Could you share any kind of solutions on this issue ?

If you came here from google as I did...

Hello there :)

Was this page helpful?
0 / 5 - 0 ratings