I try to use sb-edit npm package in my angular project. When I read *.sb3 json file
const project = Project.fromSb3JSON(this.projectJSON, { getAsset: async ({ md5, ext }) => https://assets.scratch.mit.edu/internalapi/asset/${md5}.${ext}/get/ });
the compiler had thrown an exception to the below. I have created a sample javascript project and run it again. It worked fine.
WARNING in ./node_modules/prettier/index.js 9703:17-68
Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/prettier/index.js 22823:26-45
Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/prettier/index.js 44175:7-46
Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/prettier/third-party.js 4284:9-26
Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/prettier/parser-typescript.js
Module not found: Error: Can't resolve '@microsoft/typescript-etw' in '\node_modules\prettier'
ERROR in ./node_modules/prettier/index.js
Module not found: Error: Can't resolve 'fs' in 'node_modules\prettier'
ERROR in ./node_modules/prettier/third-party.js
Module not found: Error: Can't resolve 'fs' in 'node_modules\prettier'
ERROR in ./node_modules/source-map/lib/read-wasm.js
Module not found: Error: Can't resolve 'fs' in 'node_modules\source-map\lib'
ERROR in ./node_modules/prettier/third-party.js
Module not found: Error: Can't resolve 'module' in '\node_modules\prettier'
ERROR in ./node_modules/prettier/index.js
Module not found: Error: Can't resolve 'os' in '\node_modules\prettier'
ERROR in ./node_modules/prettier/third-party.js
Module not found: Error: Can't resolve 'os' in '\node_modules\prettier'
ERROR in ./node_modules/prettier/index.js
Module not found: Error: Can't resolve 'path' in '\node_modules\prettier'
ERROR in ./node_modules/prettier/third-party.js
Module not found: Error: Can't resolve 'path' in '\node_modules\prettier'
ERROR in ./node_modules/source-map/lib/read-wasm.js
Module not found: Error: Can't resolve 'path' in 'node_modules\source-map\lib'
ERROR in ./node_modules/prettier/third-party.js
Module not found: Error: Can't resolve 'stream' in '\node_modules\prettier'
I try to use sb-edit npm package in my angular project. When I read *.sb3 json file
const project = Project.fromSb3JSON(this.projectJSON, { getAsset: async ({ md5, ext }) =>
https://assets.scratch.mit.edu/internalapi/asset/${md5}.${ext}/get/});
the compiler had thrown an exception to the below. I have created a sample javascript project and run it again. It worked fine.Package.json
{ "name": "test-scratch", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "~9.1.4", "@angular/common": "~9.1.4", "@angular/compiler": "~9.1.4", "@angular/core": "~9.1.4", "@angular/forms": "~9.1.4", "@angular/platform-browser": "~9.1.4", "@angular/platform-browser-dynamic": "~9.1.4", "@angular/router": "~9.1.4", "@ngrx/effects": "^6.1.2", "@ngrx/router-store": "6.1.2", "@ngrx/store": "6.1.2", "@ngrx/store-devtools": "6.1.2", "rxjs": "~6.5.4", "sb-edit": "^0.13.9", "tslib": "^1.10.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-devkit/build-angular": "~0.901.4", "@angular/cli": "~9.1.4", "@angular/compiler-cli": "~9.1.4", "@angular/language-service": "~9.1.4", "@types/node": "^12.11.1", "@types/jasmine": "~3.5.0", "@types/jasminewd2": "~2.0.3", "codelyzer": "^5.1.2", "jasmine-core": "~3.5.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~5.0.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~2.1.0", "karma-jasmine": "~3.0.1", "karma-jasmine-html-reporter": "^1.4.2", "protractor": "~5.4.3", "ts-node": "~8.3.0", "tslint": "~6.1.0", "typescript": "~3.8.3" } }