-
Notifications
You must be signed in to change notification settings - Fork 44
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
Error: SyntaxError: possible import expression rejected around line 1 #36
Comments
Turns out import.ts file name is somehow breaking internal logic or package that figma is using to run plugin. can you guys share us what that is?
|
Firstly, have you tried enabling Developer VM in order to see more detailed error messages? Without it the error can be completely different from what is actually happening in your code. Secondly, there is a place for plugins API issues: https://forum.figma.com/c/plugin-api/20 — you can even choose whatever the appropriate subcategory is for your request and post there. If you think you found a bug in the API, you need to post the reproduction steps in the bugs category. If you need help from the community to figure out what could be wrong, feel free to post a question in the questions category. (I don't work for Figma) |
Hey, saw your comment on agoric-sdk and thought I'd provide a little context. The SES shim (which we develop, and now lives in https://github.com/endojs/endo/tree/master/packages/ses) transforms a regular JS environment into a more-securable "SES" (Secure ECMAScript) environment when you call To maintain this, the SES shim needs to block any instances of the "dynamic The "censor" is named The error message you got looks like it came from an earlier version of SES. The newer version might be less picky. I imagine it's up to the Figma platform to upgrade. One of the tricky and frustrating things about SES and Try searching through your source code (especially the output of any bundling step, if possible) for the word // This could be either an import
// or an export because the regexp can't tell that we're already in a comment when it sees const namespace = await
import
// intervening comment is ignored
(url) hope that helps! |
@zyumbik
Plus, can you confirm the use of endojs proposed by Above @warner's comment? Thanks @warner . that clears lots of things :) (yet i cannot solve it by only my side) Also can you propose other scenarios that something wen't wrong? I haven;t went through every single line, but i confirmed that there are no dynamic import usage and misconfigured import statement. |
I scoped down to the packaage i'm trying to import causes this error. AFAIK https://github.com/bridgedxyz/CoLI/tree/main/packages/coli-builder/import this folder causes this error. Can you confirm that naming the directory with token "import" also might cause this error? @warner |
I wouldn't expect a directory by that name to cause a problem, but source bundling steps might incorporate it into an identifier somehow, which could conceivably trip the regexp. Or if something is importing the When I've had to track this sort of think down in the past (before we improved the regexp to be less eager), my process was something (painful) like:
Not fun, but it worked at least once. The culprit turned out to be a comment I'd written that ended in the word |
Doing endless commenting out the whole lines, still having painful nights :( Or just perhaps can you modify the package to print out the import statement as error message (bundled or not) so the error can be much helpful. and I think this is necessary since it's a runtime error (at least what feels like to me) Think This talk should take a place in other thread. It just feels almost impossible to debug this. (off topic - figma's developer environment is weight too poor) P.s. can you share the regex value? so i can search the dist source and original source with that |
@warner So i found where the error is caused. Removing the class member method It's not caused by comment or any other thing but method named I think class is not cuasing the problem (I don't know since Does the ses package has the logic not the check the function named Reference: gridaco/CoLI#11 (comment) |
Closing this issue, creating new one on endojs |
This is not the right place for posting this issue. but since figma does not have a adequate place for these issues on github, i'm posting here.
I have perfectly working fine module which runs on a browser, but when i import and run on figma platform it won't run with following error.
I'm sorry i cannot provide more context, but figma does not provide any readable context either. can you contact developers team and check if this is a known issue or provide more context so i can find where to start with my debugging?
Referencing Agoric/agoric-sdk#43 (comment)
The text was updated successfully, but these errors were encountered: