I have a project where it compiles and runs just fine on mac/linux and WSL inside windows. But running on Windows, I get errors relating to “SASS Compiler Error” and there appear to be paths that are being transformed and injected somewhere, but wrongly or incompletely. New to meteor, trying to figure out where to even look to debug. Again, the exact same project compiles and works no issue on *nix. I have tried with meteor 3.0.4, 3.0.2, and currently 3.0.3 and no difference on Windows or Linux.
=> Started proxy.
=> Started HMR server.
=> Meteor 3.0.4 is available. Check the changelog https://docs.meteor.com/history.html and update this project with 'meteor update'.
C:\Users\XXX\AppData\Local\.meteor\packages\meteor-tool\3.0.3\mt-os.windows.x86_64\tools\runners\run-app.js:380
throw e;
^
Error: _get "data" called for file with pending errors | ERROR: {"message":"SASS Compiler Error: Error: File to import: XDOTX/stylesXDOTXscss not found in file: /C/Users/XXX/Documents/YYY/repos/PROJECT-NAME/{}/imports/ui/scss/root.scss\n ╷\n1 │ @import 'XDOTX/stylesXDOTXscss';\n │ ^^^^^^^^^^^^^^^^^^^^^^^\n ╵\n {}\\imports\\ui\\scss\\root.scss 1:9 root stylesheet\n","info":{"file":"/imports/ui/scss/root.scss"}}
at CssOutputResource._get (C:\tools\isobuild\compiler-plugin.js:980:13)
at CompilerPluginProcessor.minifyCssResource (C:\tools\isobuild\bundler.js:1129:14)
at C:\tools\isobuild\compiler-plugin.js:735:19
at JsOutputResource.finalize (C:\tools\isobuild\compiler-plugin.js:938:7)
at JsOutputResource.hasPendingErrors (C:\tools\isobuild\compiler-plugin.js:943:5)
at JsOutputResource.reportPendingErrors (C:\tools\isobuild\compiler-plugin.js:948:9)
at ImportScanner.scanFile (C:\Users\XXX\AppData\Local\.meteor\packages\meteor-tool\3.0.3\mt-os.windows.x86_64\tools\isobuild\tools\isobuild\import-scanner.ts:1085:9)
at ImportScanner.scanFile (C:\Users\XXX\AppData\Local\.meteor\packages\meteor-tool\3.0.3\mt-os.windows.x86_64\tools\isobuild\tools\isobuild\import-scanner.ts:1144:9)
at ImportScanner.scanImports (C:\Users\XXX\AppData\Local\.meteor\packages\meteor-tool\3.0.3\mt-os.windows.x86_64\tools\isobuild\tools\isobuild\import-scanner.ts:741:9)
at Function.computeJsOutputFilesMap (C:\tools\isobuild\compiler-plugin.js:1404:9)
at ClientTarget._emitResources (C:\tools\isobuild\bundler.js:1166:30)
at C:\tools\isobuild\bundler.js:861:7
at Object.enterJob (C:\tools\utils\buildmessage.js:387:12)
at ClientTarget.make (C:\tools\isobuild\bundler.js:849:5)
at C:\tools\isobuild\bundler.js:3293:7
at C:\tools\isobuild\bundler.js:3452:25
at Object.capture (C:\tools\utils\buildmessage.js:282:5)
at bundle (C:\tools\isobuild\bundler.js:3274:18)
at bundleApp (C:\tools\runners\run-app.js:584:26)
at AppRunner._runOnce (C:\tools\runners\run-app.js:629:35)
at AppRunner._runApp (C:\tools\runners\run-app.js:951:23)
Node.js v20.17.0
Ok, if you have this file and you import all other scss/sass files in it, try to comment all imports and see if you get through. If you don’t get further errors, uncomment your imports 1 by 1 until you get this error again.
Chances are that one of your styling files has errors.
I would suggest opening an issue in the Meteor repo. Meteor should show the original scss error and wait for you to change a file instead of crashing.
The error indicates a bug in Meteor’s error handling for css resources. The new error handling added in Meteor 3 probably runs too late for or doesn’t handle lazy css resources.
If anyone ever sees the Meteor tool crash with a stack trace, it indicates a bug in the Meteor tool or somewhere it needs to have better error handling. The Meteor tool was designed so this only happens when there was an unexpected error.
There are hundreds of scss files and they are mostly imported through the tool itself since they are in the input folder. I’ve tried commenting out the top level imports and it makes no change.
Pretty frustrating but it seems like there are many errors going back a decade that affect windows machines that aren’t even attempted to be fixed. Is this project is for osx only, then our whole organization will probably just move away from the project as that’s not acceptable.
Your error says @import 'XDOTX/stylesXDOTXscss'. Is this something you can start from.
Do you import the above in your root SCSS file /imports/ui/scss/root.scss
No. The XDOTX is not in my code at all. It is injected somewhere in the build process. There is another error if you look at the path where “/C/Users/XXX/Documents/YYY/repos/PROJECT-NAME/{}/imports/ui/scss/root.scss” is the main import. The random empty {} are also injected and not part of my code anywhere.
It definitely has to do with the path resolution on Windows versus *nix but I don’t know where it is.
If I go to a simple root.scss importing an empty second file (say styles.scss) it doesn’t work. I deleted all but just 2 files, 1 that calls another as an import.
If root.scss is
@import "{}/imports/ui/scss/styles.scss";
it compiles. I get other errors since I deleted many hundreds of needed styles, but it no longer complains the same way.
If root.scss has
@import "./styles.scss";
which should work (and does on linux), I get the error.
ok, there are 2 different technologies for compiling SCSS in Meteo 3. The first worked fine for many years but stopped working fine in Meteor 3 so a new one was developed.