scratchfoundation / scratch-blocks

Scratch Blocks is a library for building creative computing interfaces.
https://scratch.mit.edu/developers
Apache License 2.0
2.6k stars 1.39k forks source link

Failing to compile or build properly. Errors with scratch-blocks shim. #2040

Open Ruth3rford opened 4 years ago

Ruth3rford commented 4 years ago

Expected Behavior

it should compile correctly and allow me to view on on a localhost.

Actual Behavior

it has several errors regarding the shim in the scratch-blocks in the node modules of my scratch-gui folder and fails to compile.

the errors in powershell are here since doing npm start doesn't generate a log

ERROR in ./node_modules/scratch-blocks/shim/blockly_compressed_vertical.js
Module not found: Error: Can't resolve '../blockly_compressed_vertical' in 'C:\Slash\scratch-gui\node_modules\scratch-blocks\shim'
 @ ./node_modules/scratch-blocks/shim/blockly_compressed_vertical.js 1:17-114
 @ ./node_modules/scratch-blocks/shim/blockly_compressed_vertical.goog.js
 @ ../scratch-blocks/node_modules/imports-loader?Blockly=../shim/blocks_compressed_vertical-blockly_compressed_vertical-messages,goog=../shim/blockly_compressed_vertical.goog!../scratch-blocks/node_modules/exports-loader?Blockly!./node_modules/scratch-blocks/msg/scratch_msgs.js
 @ ./node_modules/scratch-blocks/shim/vertical.js
 @ ./src/containers/custom-procedures.jsx
 @ ./src/containers/blocks.jsx
 @ ./src/playground/blocks-only.jsx

ERROR in ./node_modules/scratch-blocks/shim/blocks_compressed_vertical.js
Module not found: Error: Can't resolve '../blocks_compressed_vertical' in 'C:\Slash\scratch-gui\node_modules\scratch-blocks\shim'
 @ ./node_modules/scratch-blocks/shim/blocks_compressed_vertical.js 1:17-201
 @ ../scratch-blocks/node_modules/imports-loader?Blockly=../shim/blocks_compressed_vertical,goog=../shim/blockly_compressed_vertical.goog!../scratch-blocks/node_modules/exports-loader?Blockly!./node_modules/scratch-blocks/msg/messages.js
 @ ./node_modules/scratch-blocks/shim/blocks_compressed_vertical-blockly_compressed_vertical-messages.js
 @ ../scratch-blocks/node_modules/imports-loader?Blockly=../shim/blocks_compressed_vertical-blockly_compressed_vertical-messages,goog=../shim/blockly_compressed_vertical.goog!../scratch-blocks/node_modules/exports-loader?Blockly!./node_modules/scratch-blocks/msg/scratch_msgs.js
 @ ./node_modules/scratch-blocks/shim/vertical.js
 @ ./src/containers/custom-procedures.jsx
 @ ./src/containers/blocks.jsx
 @ ./src/playground/blocks-only.jsx

image this main offending files

npm install scratch-gui, scratch-vm, scratch-blocks, do npm link on scratch-vm and scratch-blocks, then link them through scratch-gui folder. through the scratch-gui folder do npm start, it fails to compile.

Windows 10, Google Chrome

hyansuper commented 4 years ago

same on ubuntu18

benjiwheeler commented 4 years ago

Could you give the specific series of commands that you ran, so we could reproduce this?

jaafreitas commented 4 years ago

I have this issue on Windows 10. As a workaround I built it on Bash on Linux (Ubuntu 18.04) on Windows.

hyansuper commented 4 years ago

fixed. in scratch-blocks folder, type: npm run prepublish this command requires java(and python2) be installed, if not, install java with apt install default-jre