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_IMPORT_REJECTED lacks location of offending code #2430

Open
dckc opened this issue Aug 27, 2024 · 1 comment
Open

SES_IMPORT_REJECTED lacks location of offending code #2430

dckc opened this issue Aug 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@dckc
Copy link
Contributor

dckc commented Aug 27, 2024

Describe the bug

When I hit SES_IMPORT_REJECTED, I expect to see the file and line number of the syntax error, but all I get is a stack trace of endo code that did the rejecting.

It's like a compiler crash instead of a compiler reporting an error in the compiled code:

REJECTED from ava test("Start the contract"): (SyntaxError#2)
SyntaxError#2: Possible import expression rejected at <unknown>:7. (SES_IMPORT_REJECTED)
  at Object.execute (.../compartment-mapper/src/parse-pre-cjs.js:30:27)
  at require (.../compartment-mapper/src/parse-cjs-shared-export-wrapper.js:135:29)
  at eval (eval at <anonymous> (eval at makeEvaluate (file:///tmp/noble-hashes-app/node_modules/ses/src/make-evaluate.js:92:27)), <anonymous>:5:20)
  at Object.execute (.../compartment-mapper/src/parse-pre-cjs.js:40:1)
  at require (.../compartment-mapper/src/parse-cjs-shared-export-wrapper.js:135:29)
  at eval (eval at <anonymous> (eval at makeEvaluate (file:///tmp/noble-hashes-app/node_modules/ses/src/make-evaluate.js:92:27)), <anonymous>:4:18)
  at Object.execute (.../compartment-mapper/src/parse-pre-cjs.js:40:1)
  at eval (.../noble-hashes-app-contract/src/offer-up.contract.js:1:182)
  at async importBundle (.../import-bundle/src/index.js:57:18)

Steps to reproduce

See Agoric/agoric-sdk#9958 (reply in thread)

Expected behavior

file, line number where the SyntaxError occurred whenever SES_IMPORT_REJECTED is thrown.

Platform environment

yarn create @agoric/dapp clones https://github.com/Agoric/dapp-offer-up , currently at b61d102 , including resolutions such as

    "@endo/bundle-source": "2.5.2-upstream-rollup",

Additional context

cc @tgrecojs

@dckc dckc added the bug Something isn't working label Aug 27, 2024
@tgrecojs
Copy link
Contributor

thanks for opening! @dckc

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
@dckc @tgrecojs and others