skpm / sketch-dev-tools

See your plugin logs, inspect the state of Sketch documents, explore actions, and more!
MIT License
314 stars 20 forks source link

Could not build with apple silicon #69

Open Borealin opened 3 years ago

Borealin commented 3 years ago

I'm developing a sketch plugin and I want to make use of sketch-dev-tools, I found the plugin directly download from release could not work due to compatibility issue, so I turn to clone the repo and try to build by myself. And I got error log like below:

❯ npm run build

> @skpm/sketch-debugger@0.9.9 build
> skpm-build && (mkdir dev-tools.sketchplugin/Contents/Resources/.scripts || true)

[1/8] 🖨  Copied src/manifest.json in 1ms
[2/8] 🔧  Copied assets/package.json
[3/8] ⚒  Copied assets/build-script.js
[4/8] 🔩  Copied assets/icon.png
[5/8] 🛠  Built ./test-log.js in 800ms
error Error while building ./show-debugger.js
./resources/webview.html
Module build failed (from ./node_modules/_@skpm_extract-loader@2.0.3@@skpm/extract-loader/lib/extractLoader.js):
ModuleBuildError: Module build failed (from ./node_modules/_@skpm_extract-loader@2.0.3@@skpm/extract-loader/lib/extractLoader.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) TypeError: require(...) is not a function
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_webpack@4.46.0@webpack/lib/NormalModule.js:313:13
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:367:11
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:233:18
    at runSyncOrAsync (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:143:3)
    at iterateNormalLoaders (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:232:2)
    at iterateNormalLoaders (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:236:3
    at context.callback (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:111:13)
    at Object.<anonymous> (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_css-loader@1.0.1@css-loader/lib/loader.js:133:3)
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_css-loader@1.0.1@css-loader/lib/processCss.js:193:3
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_webpack@4.46.0@webpack/lib/NormalModule.js:316:20
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:367:11
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:233:18
    at runSyncOrAsync (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:143:3)
    at iterateNormalLoaders (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:232:2)
    at iterateNormalLoaders (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:236:3
    at context.callback (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:111:13)
    at Object.<anonymous> (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_css-loader@1.0.1@css-loader/lib/loader.js:133:3)
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_css-loader@1.0.1@css-loader/lib/processCss.js:193:3
 @ ./src/show-debugger.js 54:24-60
./node_modules/_codemirror@5.63.3@codemirror/lib/codemirror.css
Module build failed (from ./node_modules/_@skpm_extract-loader@2.0.3@@skpm/extract-loader/lib/extractLoader.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) TypeError: require(...) is not a function
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_webpack@4.46.0@webpack/lib/NormalModule.js:313:13
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:367:11
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:233:18
    at runSyncOrAsync (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:143:3)
    at iterateNormalLoaders (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:232:2)
    at iterateNormalLoaders (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:236:3
    at context.callback (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:111:13)
    at Object.<anonymous> (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_css-loader@1.0.1@css-loader/lib/loader.js:133:3)
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_css-loader@1.0.1@css-loader/lib/processCss.js:193:3
 @ ./resources/webview.html ../node_modules/codemirror/lib/codemirror.css
 @ ./src/show-debugger.js
./resources/style.css
Module build failed (from ./node_modules/_@skpm_extract-loader@2.0.3@@skpm/extract-loader/lib/extractLoader.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) TypeError: require(...) is not a function
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_webpack@4.46.0@webpack/lib/NormalModule.js:313:13
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:367:11
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:233:18
    at runSyncOrAsync (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:143:3)
    at iterateNormalLoaders (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:232:2)
    at iterateNormalLoaders (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:236:3
    at context.callback (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:111:13)
    at Object.<anonymous> (/Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_css-loader@1.0.1@css-loader/lib/loader.js:133:3)
    at /Users/borealin/Documents/inlab/sketch-dev-tools/node_modules/_css-loader@1.0.1@css-loader/lib/processCss.js:193:3
 @ ./resources/webview.html ./style.css
 @ ./src/show-debugger.js

Could you help me find if it's due to my config or arm architecture?

narol1024 commented 2 years ago

This commit is a workaround.

https://github.com/inarol/sketch-dev-tools/commit/7ae357e6021578619592af48e8573efb43b97d9e

And you could download the plugin file directly.

https://github.com/inarol/sketch-dev-tools/releases/tag/v0.9.10

laommmm commented 2 years ago

This commit is a workaround.

inarol@7ae357e

And you could download the plugin file directly.

https://github.com/inarol/sketch-dev-tools/releases/tag/v0.9.10

thx

mathieudutour commented 2 years ago

@inarol do you want to open up a PR to this repo? Happy to merge it. I can't seem to see what's the actual fix in the commit