-
Notifications
You must be signed in to change notification settings - Fork 122
Error: Error: Module not already loaded loading "fs" from "undefined". #488
Comments
I got past this error by changing the format to
Oddly enough, if I manually add a |
Looks as if, in the emscripten module,
|
Not sure the best way to proceed here. Is there a way in SystemJS to inject/define global variables such as |
@dougludlow maybe you want to investigate why emscripten is kicking off in shell mode. |
When the format is When I set the format to |
It appears the error is thrown from amd-helpers.js where a version of |
@dougludlow more generally this is just about configuring SystemJS for compatibility with Node-based assumptions. jspm is designed exactly to do this configuration automatically when you do By default SystemJS makes none of the Node environment assumptions - To make this work you need to use SystemJS configuration to provide shim libraries, which might look something like: System.config({
map: {
sass: 'node_modules/sass.js',
process: 'path/to/process-shim',
fs: 'path/to/fs-shim'
},
packages: {
'node_modules/sass.js': {
format: 'cjs',
meta: {
'dist/sass.sync.js': {
globals: {
process: 'process/global.js'
}
}
}
}
}
}); when done manually, although I haven't tested the above. |
The specific |
But there will be many more quirks... |
Thanks @guybedford, I think I'm beginning to see. Here's the situation. I'm trying to test out a series of fixes to both sass.js and plugin-sass, but the fixes are in branches, so I've installed the branches via jspm. I guess the issue I'm running into is I'm installing plugin-sass via my github fork's branch, but I don't know how to make JSPM resolve the sass.js's feature branch as NPM. Here's what I'm doing:
But that doesn't appear to make any difference. |
The sass.js branch hasn't been merged in yet and isn't available on npm, so in my branch I installed it like so:
|
Ha ha, thanks @rodneyrehm. I'll give that a go. |
@rodneyrehm yup, that works now. Thanks so much! @guybedford I'm still curious though, is the only way to shim a github package dependency via meta in the config.js or is there a way to pass in an override in jspm install? |
From your override example above, it should actually be:
Or alternatively just put: {
"overrides": {
"github:medialize/sass.js@importer-options": {
"registry": "npm"
}
}
} In the package.json. |
Thanks @guybedford! |
I'm trying to use Sass.js in the SystemJS builder. However, I'm receiving the following error:
I'm attempting to fix an issue in plugin-sass, but in updating the sass.js dependency, I see this error. sass.sync.js is being loaded, it has an emscripten module embedded in it, which requires 'fs'. Any ideas what's going on here?
This is occurring in
[email protected]
and[email protected]
.The text was updated successfully, but these errors were encountered: