plasmo
plasmo copied to clipboard
[BUG] import.meta failing firefox submission check
What happened?
A bug happened!
firefox submission fails if i import svg icons using
import "url:./../assets/some-icon.svg"
firefox store throws an error when the extension is submitted.
the import line above results in import.meta
injected into bundled code for popup.tsx.
I have solved this by including the svg relative path in manifest.json and then obtaining the url using chrome.runtime.getUrl('./assets/some-icon.svg')
in popup.tsx.
The bundled applications works fine (both dev and build). But firefox addons submission page will reject it.
Its not an issue now for me but thought you should know. Someone else might bang their head for a few hours if they run into this.
Cheers from JiffyReader. This is really an awesome project.
Version
Latest
What OS are you seeing the problem on?
Linux
What browsers are you seeing the problem on?
Firefox
Relevant log output
No response
(OPTIONAL) Contact Details
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
- [X] I checked the current issues for duplicate problems.
the import line above results in import.meta injected into bundled code for popup.tsx.
hmm... is this like Mozilla's reviewer's decision not to have this directive in the final bundle? I wonder why
There's a linter that is blocking it. They run the submission through the linter automatically.
There a Mozilla support thread on it where I guess a senior staff probably made a fix to allow the linter allow import.meta from a long time ago
But the linter still rejected my code submission
This is a link of the issue on Mozillas Github
https://github.com/mozilla/addons-linter/issues/3639
Another way to work around this IMO, is to use the data-base64:
scheme and consume the SVG inside the source code instead of as an asset
But I think we can close this for now as this is not a Plasmo issue per-se, but a good pre-cautious for folks publishing to Mozilla store