You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a script contains the text System.register then StealJS seams to assume that this file is a SystemJS module. That would be fine if the file actually did call System.register() but actually my script calls FileSystem.registerFileSystem() which has nothing to do with SystemJS. Looks like the regular expression which looks for System.register is not exact enough. Maybe it could simply be changed to /\bSystem\.register/?
Steps to reproduce:
Try to load a file with the following content:
require("fs.js");FileSystem.registerFileSystem();
Expected results:
Steal should load the dependency fs.js (or complain that this file could not be loaded).
Actual results:
The error ReferenceError: require is not defined is thrown: I think this is because StealJS assumes the file is a SystemJS module instead of a CommonJS module and therefor doesn't provide the require function.
Remove the second line in the example or change it so it doesn't match System.register and then it works correctly.
Environment:
Software
Version
Steal version
2.2.1
Steal-tools version
-
node -v
-
npm -v
-
Browser
Chrome 75.0.3770.100
Operating system
Debian Linux 10
The text was updated successfully, but these errors were encountered:
How often can you reproduce it?
Description:
When a script contains the text System.register then StealJS seams to assume that this file is a SystemJS module. That would be fine if the file actually did call System.register() but actually my script calls FileSystem.registerFileSystem() which has nothing to do with SystemJS. Looks like the regular expression which looks for
System.register
is not exact enough. Maybe it could simply be changed to/\bSystem\.register/
?Steps to reproduce:
Try to load a file with the following content:
Expected results:
Steal should load the dependency
fs.js
(or complain that this file could not be loaded).Actual results:
The error
ReferenceError: require is not defined
is thrown: I think this is because StealJS assumes the file is a SystemJS module instead of a CommonJS module and therefor doesn't provide the require function.Remove the second line in the example or change it so it doesn't match System.register and then it works correctly.
Environment:
The text was updated successfully, but these errors were encountered: