Open SeekerOfTrueCode opened 1 year ago
Seeing this too!
For others, for dev
(unlike build
) you must set up the page in web_accessible_resources
in the manifest as well
For others, for
dev
(unlikebuild
) you must set up the page inweb_accessible_resources
in the manifest as well
@sublimator I added it, but it still does not work for me. I provided my code in the following comment. Could you check it? https://github.com/crxjs/chrome-extension-tools/issues/627#issuecomment-1970560038
Build tool
Rollup
Where do you see the problem?
Describe the bug
Issue Summary:
An issue has been identified involving the usage of an extra page named "offscreen.html," which is configured as an offscreen document within the background.ts script (part of the service worker in the manifest). This offscreen document includes a script named "src/offscreen.ts" which undergoes proper transformation during the build process. Both the script file and its source are transformed as expected.
However, a complication arises when executing the command npm run dev with the mode set to staging (vite --mode staging). During this process, the file referenced within the "offscreen.html" document fails to update its reference to the transformed file's name. Instead, it retains the reference to the old file's name, which no longer exists in the "dist" folder and doesn't even successfully transform (nowhere to be found in dist folder).
Expected Behavior: Upon running the dev process with the staging mode, the reference to the transformed file's name within the "offscreen.html" document should be updated to reflect the changes made during the transformation process and ts file "src/offscreen.ts" should undergo transformation and should be added to the dist folder.
Actual Behavior: The reference to the transformed file's name within the "offscreen.html" document remains unchanged, leading to incorrect referencing and a discrepancy between the expected and actual filenames. No file to be found.
Files in source:
scripts/constants/paths.ts
vite.config.ts
offscreen.html
src/offscreen.ts
manifest.config.ts
Reproduction
Link to my repo's branch which is reproducing this problem: https://github.com/SeekerOfTrueCode/template-crxjs-web-extension/tree/issue/extra-html_script-src_not-transformed_in-dev
System Info
Severity
annoyance