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

SyntaxError: Cannot use import statement outside a module #3

Open
savissimo opened this issue Sep 6, 2021 · 0 comments
Open

SyntaxError: Cannot use import statement outside a module #3

savissimo opened this issue Sep 6, 2021 · 0 comments

Comments

@savissimo
Copy link

Hi,

I've downloaded the project and tried to start a new project, but when I ran yarn start I got this error:

SyntaxError: Cannot use import statement outside a module

It's the first of several errors: this is the full output.

Hash: b1b3ba31d294236f7496
Version: webpack 3.12.0
Time: 744ms
                                      Asset       Size  Chunks             Chunk Names
assets/680cc53b169b85a0f6f38e81bdbe6ae7.png  608 bytes          [emitted]
assets/97cf154a0cfd1bc32d9bbd3ecdb5039c.png  966 bytes          [emitted]
assets/b22c4bab11c61f1f3a7f30f23eaf6958.png    1.86 kB          [emitted]
assets/9b4d7806bf6c720e7457a4f98f4bd0e0.png    3.94 kB          [emitted]
assets/4c3924c036400f331da5c5c25db38ae5.png    1.42 kB          [emitted]
assets/a21ed6864fa22cd067af0e1dc70b4578.png    4.31 kB          [emitted]
assets/66b04ade4c414e010b3403d74e2fce1c.png    11.9 kB          [emitted]
                              manifest.json    3.96 kB       0  [emitted]  main
   [0] ./src/manifest.json 1.49 kB {0} [built] [failed] [1 error]
   [1] ./node_modules/prop-loader?name!./package.json 44 bytes [built]
   [2] ./node_modules/prop-loader?version!./package.json 25 bytes [built]
   [3] ./node_modules/prop-loader?description!./package.json 48 bytes [built]
   [4] ./node_modules/prop-loader?author!./package.json 55 bytes [built]
   [5] ./src/options/index.html 0 bytes [not cacheable] [built]
   [6] ./src/icon/16.png 89 bytes [built]
   [7] ./src/icon/48.png 89 bytes [built]
   [8] ./src/icon/96.png 89 bytes [built]
   [9] ./src/icon/128.png 89 bytes [built]
  [10] ./src/popup/index.html 0 bytes [not cacheable] [built]
  [11] ./src/popup/icon/16.png 89 bytes [built]
  [12] ./src/popup/icon/32.png 89 bytes [built]
  [13] ./src/popup/icon/64.png 89 bytes [built]
  [14] ./src/background/index.js 1.49 kB [built]
    + 1 hidden module

ERROR in ./src/manifest.json
Module build failed: ./background/index.js:6
import { getOS } from './getos';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at new Script (vm.js:100:7)
    at runScript (D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\extricate-loader\index.js:65:18)
    at Object.<anonymous> (D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\extricate-loader\index.js:33:42)
    at next (D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\webpack\lib\dependencies\LoaderPlugin.js:52:15)
    at D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\webpack\lib\dependencies\LoaderPlugin.js:29:12
    at processTicksAndRejections (internal/process/task_queues.js:75:11)

ERROR in ./src/manifest.json
Module build failed: ModuleBuildError: Module build failed: ./background/index.js:6
import { getOS } from './getos';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at new Script (vm.js:100:7)
    at runScript (D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\extricate-loader\index.js:65:18)
    at Object.<anonymous> (D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\extricate-loader\index.js:33:42)
    at next (D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\webpack\lib\dependencies\LoaderPlugin.js:52:15)
    at D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\webpack\lib\dependencies\LoaderPlugin.js:29:12
    at processTicksAndRejections (internal/process/task_queues.js:75:11)
    at D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\webpack\lib\NormalModule.js:195:19
    at D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\extricate-loader\index.js:58:13
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
 @ ./src/manifest.json
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/raw-loader/index.js!node_modules/extricate-loader/index.js!node_modules/interpolate-loader/index.js!src/manifest.json:
     7 assets
       [0] ./node_modules/raw-loader!./node_modules/extricate-loader!./node_modules/interpolate-loader!./src/manifest.json 780 bytes {0} [built] [failed] [1 error]
       [1] ./node_modules/prop-loader?name!./package.json 44 bytes [built]
       [2] ./node_modules/prop-loader?version!./package.json 25 bytes [built]
       [3] ./node_modules/prop-loader?description!./package.json 48 bytes [built]
       [4] ./node_modules/prop-loader?author!./package.json 55 bytes [built]
       [5] ./src/background/index.js 1.49 kB [built]
       [6] ./src/options/index.html 0 bytes [not cacheable] [built]
       [7] ./src/icon/16.png 89 bytes [built]
       [8] ./src/icon/48.png 89 bytes [built]
       [9] ./src/icon/96.png 89 bytes [built]
      [10] ./src/icon/128.png 89 bytes [built]
      [11] ./src/popup/index.html 0 bytes [not cacheable] [built]
      [12] ./src/popup/icon/16.png 89 bytes [built]
      [13] ./src/popup/icon/32.png 89 bytes [built]
      [14] ./src/popup/icon/64.png 89 bytes [built]
        + 1 hidden module

    ERROR in ./node_modules/raw-loader!./node_modules/extricate-loader!./node_modules/interpolate-loader!./src/manifest.json
    Module build failed: ./background/index.js:6
    import { getOS } from './getos';
    ^^^^^^

    SyntaxError: Cannot use import statement outside a module
        at new Script (vm.js:100:7)
        at runScript (D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\extricate-loader\index.js:65:18)
        at Object.<anonymous> (D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\extricate-loader\index.js:33:42)
        at next (D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\webpack\lib\dependencies\LoaderPlugin.js:52:15)
        at D:\ss\varisw\Parsifal\srs-data-parser-extension\node_modules\webpack\lib\dependencies\LoaderPlugin.js:29:12
        at processTicksAndRejections (internal/process/task_queues.js:75:11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant