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

ses-ava vs install-ses import order matters when it should not. #2663

Open
erights opened this issue Mar 16, 2021 · 3 comments
Open

ses-ava vs install-ses import order matters when it should not. #2663

erights opened this issue Mar 16, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@erights
Copy link
Member

erights commented Mar 16, 2021

The three line import sequence seen at

import { wrapTest } from '@agoric/ses-ava';

import { wrapTest } from '@agoric/ses-ava';
import '@agoric/install-ses';
import rawTest from 'ava';

happens to work. However, the more sensible import order

import '@agoric/install-ses';
import { wrapTest } from '@agoric/ses-ava';
import rawTest from 'ava';

does not. For reasons I do not understand, the latter import order causes the esm initializing logic at https://github.com/feross/buffer/blob/795bbb5bda1b39f1370ebd784bea6107b087e3a7/index.js#L816 to happen after lockdown, at which point it encounters the override mistake and fails. By importing ses-ava first, that initialization happens before lockdown successfully.

All of this happens before any of the code in ses-ava is actually executed. It seems to happen as a result of how the import order affects the initialization of other things. We did not see this before ses-ava which seems to suggest that there's something about ses-ava that is triggering this. But maybe we've just been getting lucky on import order till now. More experiments needed.

@Tartuffo
Copy link
Contributor

@erights This is in the "Up Next" pipeline, but does not have a MN-1 label. If it is needed for MN-1, please label, otherwise move from "Up Next" to "Product Backlog".

@erights
Copy link
Member Author

erights commented Dec 24, 2022

Hi @turadg , added you as it relates to other things you want to change about importing ses-ava.

@erights
Copy link
Member Author

erights commented Mar 12, 2024

See endojs/endo#2133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants