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

jsoo: spurious js.scope attribute #203

Open
mirryi opened this issue Jun 13, 2022 · 1 comment
Open

jsoo: spurious js.scope attribute #203

mirryi opened this issue Jun 13, 2022 · 1 comment
Labels
bug Something isn't working jsoo For `js_of_ocaml` target

Comments

@mirryi
Copy link

mirryi commented Jun 13, 2022

Minimal repo

When trying to generate and compile stubs from @types/webextension-polyfill, I get the following error (using ts2ocaml 1.4.4):

File "webextension_polyfill.mli", line 26594, characters 10-18:
26594 |   module[@js.scope "types"] TypesStatic : sig
                  ^^^^^^^^
Error: Spurious js.scope attribute

File "webextension_polyfill.mli", line 9, characters 37-107:
9 | [@@@js.stop] module ExtensionTypes = M_________build__default__extension_types__index.Export.ExtensionTypes [@@@js.start] [@@@js.implem module ExtensionTypes = M_________build__default__extension_types__index.Export.ExtensionTypes]
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound module M_________build__default__extension_types__index

Not sure if I'm missing something with the setup. Any help at all would be appreciated!

@cannorin
Copy link
Member

It's a bug of ts2ocaml which sometimes generates an unnecessary js.scope attributes. Note that it would work if you remove [@js.scope "types"] manually.

@cannorin cannorin added the bug Something isn't working label Jun 14, 2022
@cannorin cannorin added the v2 label Jul 13, 2023
@cannorin cannorin added jsoo For `js_of_ocaml` target and removed v2 labels Feb 27, 2024
@cannorin cannorin changed the title Spurious js.scope attribute jsoo: spurious js.scope attribute Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jsoo For `js_of_ocaml` target
Projects
None yet
Development

No branches or pull requests

2 participants