digitalevidencetoolkit/deptoolkit

Missing <script src="./index.js"></script>

jackwolfwolf opened this issue · 6 comments

Hey Guys, Great project.
Would love to get this running but i get this error.

Laden fehlgeschlagen für das <script> mit der Quelle "moz-extension://58762485-b894-44d0-a3eb-2b1ec7bd1b98/popup/index.js".

Any idea?
J

Hi Jack, I was on holiday and only picking this up now. Hope it's not delaying you too much.

So your browser can't find index.js, and I think this is because Webpack hasn't built it - see here.

Could you run the following:

$ cd extension/
$ npm install
$ npm run watch

And import the extension in your browser again?

Hey Basilesimon,
Sorry, I replied to this in an email.
Still having trouble, with the install.
Here is the NPM debug.

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'watch'
1 verbose cli ]
2 info using npm@6.14.15
3 info using node@v14.17.6
4 verbose stack Error: missing script: watch
4 verbose stack at run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:155:19)
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:63:5
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:116:5
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:436:5
4 verbose stack at checkBinReferences_ (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:391:45)
4 verbose stack at final (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:434:3)
4 verbose stack at then (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:161:5)
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:281:12
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:123:16
4 verbose stack at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:73:3)
5 verbose cwd C:\Users\JJJN\Desktop\DEPTTool\deptoolkit-main
6 verbose Windows_NT 10.0.19043
7 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "watch"
8 verbose node v14.17.6
9 verbose npm v6.14.15
10 error missing script: watch
11 verbose exit [ 1, true ]

Since the watch script definitely is in the right place, is it possible you're not in the /extension folder when running this?

Ooops my bad. It's been a while since I checked in on this.

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'watch'
1 verbose cli ]
2 info using npm@6.14.15
3 info using node@v14.17.6
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle deptoolkit-extension@1.0.0prewatch: deptoolkit-extension@1.0.0
6 info lifecycle deptoolkit-extension@1.0.0
watch: deptoolkit-extension@1.0.0
7 verbose lifecycle deptoolkit-extension@1.0.0watch: unsafe-perm in lifecycle true
8 verbose lifecycle deptoolkit-extension@1.0.0
watch: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\JJJN\Desktop\DEPTTool\deptoolkit-main\extension\node_modules.bin;C:\Python39\Scripts;C:\Python39;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\nodejs;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Git\cmd;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\PDFtk\bin;C:\Program Files\dotnet;C:\Users\JJJN\AppData\Local\Microsoft\WindowsApps;C:\Users\JJJN\AppData\Roaming\npm;C:\Users\JJJN\AppData\Local\Programs\Microsoft VS Code\bin
9 verbose lifecycle deptoolkit-extension@1.0.0watch: CWD: C:\Users\JJJN\Desktop\DEPTTool\deptoolkit-main\extension
10 silly lifecycle deptoolkit-extension@1.0.0
watch: Args: [ '/d /s /c', 'webpack -w' ]
11 silly lifecycle deptoolkit-extension@1.0.0watch: Returned: code: 1 signal: null
12 info lifecycle deptoolkit-extension@1.0.0
watch: Failed to exec watch script
13 verbose stack Error: deptoolkit-extension@1.0.0 watch: webpack -w
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:400:28)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:400:28)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid deptoolkit-extension@1.0.0
15 verbose cwd C:\Users\JJJN\Desktop\DEPTTool\deptoolkit-main\extension
16 verbose Windows_NT 10.0.19043
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "watch"
18 verbose node v14.17.6
19 verbose npm v6.14.15
20 error code ELIFECYCLE
21 error errno 1
22 error deptoolkit-extension@1.0.0 watch: webpack -w
22 error Exit status 1
23 error Failed at the deptoolkit-extension@1.0.0 watch script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

As you appear to be running Windows, would you mind trying with the Docker setup, which is there to ensure reproducibility and cross-platform?

The getting started guide still applies, but in addition you probably want something like:

$ cd extension/
$ docker build -t deptoolkit-extension .
$ docker run \
    path/to/code/extension/addon:/extension/addon \
    deptoolkit-extension