React/Webpack issue

750 views
Skip to first unread message

Ron de las Alas

unread,
May 25, 2022, 1:19:02 PM5/25/22
to Blockly
Hi,

Just getting started with Blockly - trying to implement inside for a react application. I was able to get things up and running using the example app, but have now started to implement within my own application.

When running in webpack dev server, I get an error trying to resolve the sourcemaps within blockly.

```WARNING in ../../node_modules/blockly/blockly_compressed.js
Module Warning (from ../../node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/xxx/Projects/xxx/node_modules/blockly/closure/goog/base_minimal.js' file: Error: ENOENT: no such file or directory, open '/Users/xxx/Projects/xxx/node_modules/blockly/closure/goog/base_minimal.js'```

When I Iook inside the blockly npm package I do not see that `/closure` directory that it is erroring on. Am I missing something?

Any guidance or advice would be appreciated.

App is using create-react-template and I am installing blocky ^v.8.0.2

Thanks!
Ron

Ron de las Alas

unread,
May 25, 2022, 3:10:48 PM5/25/22
to Blockly
Ah this seems to do the trick!

// Load Blockly source maps.

{

test: /(blockly\/.*\.js)$/,

use: [require.resolve('source-map-loader')],

enforce: 'pre',

},
//

M SUPER

unread,
Dec 8, 2022, 7:25:48 AM12/8/22
to Blockly
create 
.env.local 
```
GENERATE_SOURCEMAP=false 
```
Reply all
Reply to author
Forward
0 new messages