Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails in Meteor 2 #1

Open
perbergland opened this issue May 27, 2024 · 2 comments
Open

Fails in Meteor 2 #1

perbergland opened this issue May 27, 2024 · 2 comments

Comments

@perbergland
Copy link

Bug report

meteor version: 2.16

leonardoventurini:scss version: 1.1.1

I get this stack trace in an error during build:

/Users/redacted/.meteor/packages/meteor-tool/.2.16.0.g8yvo.k9wfpt++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:75:12:
   Cannot await without a Fiber
   at awaitPromise
   (/Users/redacted/.meteor/packages/meteor-tool/.2.16.0.g8yvo.k9wfpt++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:75:12)
   at Promise.await
   (/Users/redacted/.meteor/packages/meteor-tool/.2.16.0.g8yvo.k9wfpt++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:60:12)
   at CssOutputResource.finalize (/tools/isobuild/compiler-plugin.js:930:12)
   at CssOutputResource.hasPendingErrors (/tools/isobuild/compiler-plugin.js:935:10)
   at CssOutputResource._get (/tools/isobuild/compiler-plugin.js:966:14)
   at CssOutputResource.get data (/tools/isobuild/compiler-plugin.js:950:28)
   at ResourceSlot.addStylesheet (/tools/isobuild/compiler-plugin.js:784:41)
   at InputFile.addStylesheet (/tools/isobuild/compiler-plugin.js:476:24)
   at SassCompiler.compileOneFileLater (<runJavaScript-31>:91:15)

It might indicate that the compileOneFileLater method returns a promise that isn’t wrapped in Meteor.bindEnvironment.

@perbergland
Copy link
Author

After cloning the repo into packages, I can no longer reproduce the error.

I suspect that this is because when building for Meteor 3 to ensure that it is compatible with both versions, the compiled code will not be processed by reify to have await calls converted to Promise.await.

async () => {

One possible solution that is hard to test locally would be to create a Promise instance manually instead of using the await operator, but I’m not sure - I would ask zodern for advise…

@perbergland
Copy link
Author

This might work, but I have no way of testing it… It will invoke the "safe" Promise.await when executing in meteor 2 and use native await in meteor 3

const result = Promise.await ? Promise.await(getResult()) : await getResult()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant