Comments (4)
I do think this is more deno/fresh specific 😅
from preact.
Yup, going to close this out as such.
The Fresh repo can at least help with the document
error, the node:
protocol over a CDN might be a tad more difficult to solve.
from preact.
Neither issue sounds related to Preact.
Versions prior to 2.0.0 throws a node:process CORS error
Neither CORS nor node:proccess
are Preact issues.
with 2.0.0 and above the error is "document is not defined".
Fresh runs (partially) outside of the browser, in an environment where document
will not be defined. Trying to use document
in this env will correctly throw an error.
Please provide a minimal reproduction displaying how this is a problem with Preact.
from preact.
Here's the full repository with the code https://github.com/fkoemep/smiles-search
Enter this in a terminal "deno run -A -r --watch=static/,routes/,components/,utils/ dev.ts" and you get this error with versions >= v2.0.0:
ReferenceError: document is not defined
at _ (https://esm.sh/v135/@react-aria/[email protected]/X-YS9AdHlwZXMvcmVhY3QtZG9tOnByZWFjdC9jb21wYXQsQHR5cGVzL3JlYWN0OnByZWFjdC9jb21wYXQscmVhY3QtZG9tOnByZWFjdC9jb21wYXQscmVhY3QvanN4LXJ1bnRpbWU6cHJlYWN0L2NvbXBhdC9qc3gtcnVudGltZSxyZWFjdDpwcmVhY3QvY29tcGF0CmUvcHJlYWN0/denonext/utils.mjs:2:1579)
at we (https://esm.sh/v135/@react-aria/[email protected]/X-YS9AdHlwZXMvcmVhY3QtZG9tOnByZWFjdC9jb21wYXQsQHR5cGVzL3JlYWN0OnByZWFjdC9jb21wYXQscmVhY3QtZG9tOnByZWFjdC9jb21wYXQscmVhY3QvanN4LXJ1bnRpbWU6cHJlYWN0L2NvbXBhdC9qc3gtcnVudGltZSxyZWFjdDpwcmVhY3QvY29tcGF0CmUvcHJlYWN0/denonext/utils.mjs:2:1627)
at ee (https://esm.sh/v135/@react-aria/[email protected]/X-YS9AdHlwZXMvcmVhY3QtZG9tOnByZWFjdC9jb21wYXQsQHR5cGVzL3JlYWN0OnByZWFjdC9jb21wYXQscmVhY3QtZG9tOnByZWFjdC9jb21wYXQscmVhY3QvanN4LXJ1bnRpbWU6cHJlYWN0L2NvbXBhdC9qc3gtcnVudGltZSxyZWFjdDpwcmVhY3QvY29tcGF0CmUvcHJlYWN0/denonext/interactions.mjs:2:17263)
at Ce (https://esm.sh/v135/@react-aria/[email protected]/X-YS9AdHlwZXMvcmVhY3QtZG9tOnByZWFjdC9jb21wYXQsQHR5cGVzL3JlYWN0OnByZWFjdC9jb21wYXQscmVhY3QtZG9tOnByZWFjdC9jb21wYXQscmVhY3QvanN4LXJ1bnRpbWU6cHJlYWN0L2NvbXBhdC9qc3gtcnVudGltZSxyZWFjdDpwcmVhY3QvY29tcGF0CmUvcHJlYWN0/denonext/interactions.mjs:2:19622)
at V (https://esm.sh/v135/@react-aria/[email protected]/X-YS9AdHlwZXMvcmVhY3QtZG9tOnByZWFjdC9jb21wYXQsQHR5cGVzL3JlYWN0OnByZWFjdC9jb21wYXQscmVhY3QtZG9tOnByZWFjdC9jb21wYXQscmVhY3QvanN4LXJ1bnRpbWU6cHJlYWN0L2NvbXBhdC9qc3gtcnVudGltZSxyZWFjdDpwcmVhY3QvY29tcGF0CmUvcHJlYWN0/denonext/focus.mjs:2:12915)
at dd (https://esm.sh/v135/@headlessui/[email protected]/X-YS9AdHlwZXMvcmVhY3QtZG9tOnByZWFjdC9jb21wYXQsQHR5cGVzL3JlYWN0OnByZWFjdC9jb21wYXQscmVhY3QtZG9tOnByZWFjdC9jb21wYXQscmVhY3QvanN4LXJ1bnRpbWU6cHJlYWN0L2NvbXBhdC9qc3gtcnVudGltZSxyZWFjdDpwcmVhY3QvY29tcGF0CmUvcHJlYWN0/denonext/react.mjs:6:102879)
at Object.t (https://esm.sh/stable/[email protected]/denonext/compat.js:2:1545)
at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:3237)
at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:2543)
at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:3802)
And this error appears on devtools with versions above 1.7.17 but below 2.0.0:
Access to script at 'node:process' from origin 'http://localhost:8000' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome-untrusted, https, edge.
node:process:1
Failed to load resource: net::ERR_FAILED
It might be an esm.sh, preact, Deno, fresh, std or headlessui issue but I'm not really sure. If you could point me in the right direction I would be very grateful.
from preact.
Related Issues (20)
- [preact/compat] [Next.js] Uncaught TypeError: (0 , l.use) is not a function HOT 3
- render() with popover doesn't work HOT 2
- False positive on render loop detection HOT 1
- Rendering just gets slower over time HOT 18
- hate your ukraine banner
- one more time on the Ukraine banner HOT 2
- Boolean values not handled as expected for `popover` prop
- Suggestion, stay away from politics
- Type errors involving `forwardRef` and `Ref` in the compatibility layer. HOT 3
- Color of ix-icon-button HOT 1
- Starting from version 10.20 will cause the order of child elements to be reversed HOT 18
- `package.json#exports.browser` does not adhere to Node module type semantics HOT 3
- Preact is not working for tailwindcss & react-icons HOT 5
- [email protected] unexpected child ordering with skew based diff
- [email protected] application is broken on old user agents HOT 2
- syntax for choosing setting a property vs attribute on elements HOT 8
- useEffect never called HOT 2
- JSX prop works incorrectly on Custom Element, Preact fails to detect JS property setter HOT 5
- [preact/hooks] useMemo keeps recalculating even when the dependency is not changed HOT 2
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 preact.