Comments (9)
Hi! Can you test now? It should be fine π
from edge-runtime.
Hello @brycewray, sorry for the delay, and thanks for attaching all these details, it's really appreciated.
I don't think it's an Edge Runtime issue, but still a Vercel infrastructure issue, so I'm going to reproduce and try to understand why it's happening, let me keep you in touch π
from edge-runtime.
We disabled the email obfuscation that should never have been enabled and the issue it's gone, so thanks a lot for reporting this
from edge-runtime.
Apparently not of interest beyond me. Disregard. Site is now off Vercel, so the static-site-omega.vercel.app
project is back to being only a holder.
Edit: Ironically enough, the oddity doesnβt appear on the new/previous location, Cloudflare Pages, since I have this feature turned off β as, indeed, I did while the site was on Vercel but DNS was going through Cloudflare. Weird.
from edge-runtime.
Re-opening this because I would still appreciate an answer. :) If I need to rebuild the static-site-omega.vercel.app
project to its previous state (as mentioned above) so anyone at Vercel can take a run at this, let me know.
from edge-runtime.
@Kikobeats Thanks! I am currently running some tests of my own, switching out some items in middleware.js
to see whether I can find the offending item. π If I find it, I'll advise here.
from edge-runtime.
@Kikobeats It appears to be related to the following part of my middleware.js
file, where I use replace
to add generated nonces to the HTML for the Content Security Policy; if I comment this out, the bogus script doesnβt appear:
const html = (await response.text())
.replace(/DhcnhD3khTMePgXw/gi, nonce)
.replace(
'rel="stylesheet"',
`rel="stylesheet" nonce="${nonce}"`
)
.replace(/<link rel="preload"/g, `<link nonce="${nonce}" rel="preload"`)
.replace(
'guitar-thriving.brycewray.com/script.js"',
`guitar-thriving.brycewray.com/script.js" nonce="${nonce}"`
)
.replace(
'src="/assets/js/lite-yt-embed_',
`nonce="${nonce}" src="/assets/js/lite-yt-embed_`
)
.replace(/<style/g, `<style nonce="${nonce}"`)
I also tried commenting out each separate replace
statement to see if one of them was the cause, and it made no difference; only commenting out all of the code shown above would remove the bogus script.
Also: I was able to recreate the same issue on another repo by using the middleware.js
file (with replace
statements intact) and adding text that triggered the bogus script on one of the first repoβs pages:
https://hosts-test.vercel.app/posts/2022/05/another-test-4/
. . . so this pretty well confirms that, somehow, the replace
statements are causing this.
from edge-runtime.
Hello @brycewray, sorry for the delay, and thanks for attaching all these details, it's really appreciated.
I don't think it's an Edge Runtime issue, but still a Vercel infrastructure issue, so I'm going to reproduce and try to understand why it's happening, let me keep you in touch π
@Kikobeats Any luck yet? During my tests, I found one page where, if someone has JS deactivated, this oddity actually changes a Mastodon link to some error message about email obfuscation π β so, needless to say, I canβt use Vercel for my site until/unless this is fixed. Thanks again for whatever time you have to spend on this.
from edge-runtime.
Hi! Can you test now? It should be fine π
@javivelasco Yes, appears to be fixed. Checked several of the βtroubleβ pages and saw no bogus script. π What turned out to be the problem?
from edge-runtime.
Related Issues (20)
- Expose cookie serialization functions. HOT 1
- Include a key in process.versions for detecting edge runtime HOT 2
- Support `has` in ResponseCookies
- Set-Cookie headers are merged when using `fetch` HOT 6
- Primitives: event-target-shim causes issues w/ edge-runtime running on top of node HOT 3
- drop node16 support
- Proxying primitive instances return anonymous `toString()` return functions
- Why cannot my `fetch` API work in edge function? HOT 4
- π`fetch` api doesn't work in edge function HOT 4
- Which functions and APIs advance the value returned by `Date.now`? HOT 3
- Polyfill for btoa inconsistent with WebApi / Node HOT 5
- drop node18 support
- Response.redirect() fails to parse some URLs in production which parse successfully in local runtime HOT 2
- `@edge-runtime/node-utils` can't start example server from docs using `primitives` (node v18.18.2) Headers2 is not a constructor HOT 1
- Secure Cookies can't be deleted from Responses
- CompressionStream / DecompressionStream support?
- failing on buffer
- Does Edge Runtime use alternative vm instead of node:vm? HOT 3
- crypto.subtle.importKey does not accept ArrayBuffer (ArrayBuffer.prototype mismatch) HOT 1
- Cannot use @edge-runtime/jest-environment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edge-runtime.