deno
deno copied to clipboard
@headless/react issues
Version: Deno v1.43.3
Here's the full repository with the my project: https://github.com/fkoemep/smiles-search
I'm working with the @headless/react library v1.7.17, if I upgrade it to any newer version I get the following errors:
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
Here is my entire deno.json file:
{
"lock": false,
"tasks": {
"check": "deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
"start": "deno run -A --watch=static/,routes/ main.ts",
"build": "deno run -A dev.ts build",
"preview": "deno run -A main.ts",
"update": "deno run -A -r https://fresh.deno.dev/update ."
},
"lint": {
"rules": { "tags": ["recommended", "fresh"], "exclude": ["prefer-const"] }
},
"nodeModulesDir": true,
"imports": {
"$fresh/": "https://deno.land/x/[email protected]/",
"$std/": "https://deno.land/[email protected]/",
"preact": "https://esm.sh/[email protected]?dts",
"preact/": "https://esm.sh/[email protected]/",
"@preact/signals": "https://esm.sh/*@preact/[email protected]?dts",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]?dts",
"@fontsource/roboto": "https://esm.sh/@fontsource/roboto?dts",
"tailwindcss": "npm:[email protected]",
"tailwindcss/": "npm:[email protected]/",
"tailwindcss/plugin": "npm:[email protected]/plugin.js",
"icons": "https://esm.sh/@heroicons/react/16/solid?alias=react:preact/compat",
"@headlessui/react": "https://esm.sh/@headlessui/[email protected]?alias=react:preact/compat,react-dom:preact/compat,react/jsx-runtime:preact/compat/jsx-runtime,@types/react:preact/compat,@types/react-dom:preact/compat&external=preact&deno-std=2024.05.07&dts",
"@mui/base": "https://esm.sh/@mui/[email protected]?alias=react:preact/compat,react-dom:preact/compat,react/jsx-runtime:preact/compat/jsx-runtime,@types/react:preact/compat,@types/react-dom:preact/compat&external=preact&deno-std=2024.05.07&dts",
"bottleneck": "npm:bottleneck",
"components/": "./components/",
"utils/": "./utils/",
"api": "./utils/api.js",
"islands/": "./islands/",
"juani/": "https://esm.sh/gh/juanidambrosio/smileshelper/"
},
"compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" },
"exclude": ["**/_fresh/*"],
"install @mui/material": "\"@emotion/react/\": \"https://esm.sh/@emotion/[email protected]?alias=react:preact/compat,react-dom:preact/compat,react/jsx-runtime:preact/compat/jsx-runtime,@types/react:preact/compat,@types/react-dom:preact/compat&[email protected]/\",\"@emotion/styled/\": \"https://esm.sh/@emotion/[email protected]?alias=react:preact/compat,react-dom:preact/compat,react/jsx-runtime:preact/compat/jsx-runtime,@types/react:preact/compat,@types/react-dom:preact/compat&[email protected]/\",\"@mui/material\": \"https://esm.sh/@mui/[email protected]?alias=react:preact/compat,react-dom:preact/compat,react/jsx-runtime:preact/compat/jsx-runtime,@types/react:preact/compat,@types/react-dom:preact/compat&[email protected]&dts\""
}