Code Monkey home page Code Monkey logo

Comments (13)

ije avatar ije commented on May 13, 2024

i will figure it out, thanks!

you can try to disable the types check temporarily:

export { default as React } from "https://esm.sh/[email protected]?no-check";
export { default as ReactDOM } from "https://esm.sh/[email protected]?no-check";

from esm.sh.

ije avatar ije commented on May 13, 2024

@quaos deno bundle src/client.tsx public/assets/js/client.js without --config seems works fine in my case:

Screenshot 2020-11-13 at 20 57 07

can you please post the tsconfig.json?

from esm.sh.

quaos avatar quaos commented on May 13, 2024

@ije Here:
tsconfig.json

{
  "compilerOptions": {
    "isolatedModules": false,
    "allowJs": false,
    "allowUnreachableCode": false,
    "allowUnusedLabels": false,
    "alwaysStrict": true,
    "checkJs": false,
    "disableSizeLimit": false,
    "jsx": "react",
    "jsxFactory": "React.createElement",
    "lib": ["DOM", "ESNext"],
    "noFallthroughCasesInSwitch": false,
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noImplicitUseStrict": false,
    "noStrictGenericChecks": false,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "removeComments": false,
    "strict": true,
    "strictBindCallApply": true,
    "strictFunctionTypes": true,
    "strictNullChecks": true,
    "strictPropertyInitialization": true,
    "suppressExcessPropertyErrors": false,
    "suppressImplicitAnyIndexErrors": false
  },
  "deno": true
}

In my case, omitting --config still yields the same errors, with more errors about jsx added in:

TS17004 [ERROR]: Cannot use JSX unless the '--jsx' flag is provided.
    <App />,

from esm.sh.

quaos avatar quaos commented on May 13, 2024

i will figure it out, thanks!

you can try to disable the types check temporarily:

export { default as React } from "https://esm.sh/[email protected]?no-check";
export { default as ReactDOM } from "https://esm.sh/[email protected]?no-check";

Thanks, the bundle succeeded with ?no-check !
However, the result client.js still has error in browser:

Uncaught ReferenceError: __react is not defined
    at require (client.js:370)

client.js.zip

from esm.sh.

ije avatar ije commented on May 13, 2024

i guess this is a bug of deno bundler.

from esm.sh.

ije avatar ije commented on May 13, 2024

FYI please check denoland/deno#8344

from esm.sh.

ije avatar ije commented on May 13, 2024

@quaos to get react render details error message, you can use esm.sh's dev mode:

import _React from 'https://esm.sh/[react,react-dom]/react?dev'
import _ReactDOM from 'https://esm.sh/[react,react-dom]/react-dom?dev'
export const React = _React
export const ReactDOM = _ReactDOM

from esm.sh.

quaos avatar quaos commented on May 13, 2024

@ije Somewhat after using development mode, the error is gone and React components loaded successfully now.

import _React from 'https://esm.sh/[react,react-dom]/react?dev&no-check';
import _ReactDOM from 'https://esm.sh/[react,react-dom]/react-dom?dev&no-check';

from esm.sh.

ije avatar ije commented on May 13, 2024

cool, what deno version you are using? i don't need no-check flag in deno 1.5.2

from esm.sh.

ije avatar ije commented on May 13, 2024

consider use Aleph.js ?

from esm.sh.

quaos avatar quaos commented on May 13, 2024

@ije I also uses 1.5.2, but do not work without no-check

>deno --version
deno 1.5.2 (71d7482, release, x86_64-pc-windows-msvc)
v8 8.7.220.3
typescript 4.0.5

However, this is the repo I've been working on:
deno-react-minimal-frontend

from esm.sh.

ije avatar ije commented on May 13, 2024

cool!

from esm.sh.

quaos avatar quaos commented on May 13, 2024

@ije So I suppose you can close this issue for now 😎

from esm.sh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.