vitext icon indicating copy to clipboard operation
vitext copied to clipboard

Intro Example should not be broken

Open frol opened this issue 2 years ago • 7 comments

I tried intro example and bumped into a few problems:

  1. vitext 0.0.1 is deleted, so I had to update it to 0.0.2 in the intro/package.json
  2. next, npm run dev failed to start due to: Error: Cannot find module 'react-refresh/cjs/react-refresh-runtime.development.js'. I Resolved it with npm add -D react-refresh
  3. next, while npm run dev brought the server up and running, it does not work well ("increase" and "decrease" buttons do not work), and I see the following error in the terminal, if that helps: image

Environment:

  • Arch Linux, x86-64
  • node.js 16.6.1
  • npm 7.20.5
  • vitext example from master branch

P.S. Cool project! :+1:

frol avatar Aug 08 '21 17:08 frol

Thank you @frol, That's really helpful. I'll fix it soon.

Aslemammad avatar Aug 08 '21 19:08 Aslemammad

Hey @frol, How are you doing? Sorry for the late response; I was infected by covid. I pushed #13, check out the new release & see if it works for you!

Aslemammad avatar Aug 31 '21 19:08 Aslemammad

@Aslemammad Hey! I hope you are doing well now :pray:

I tried it again:

$ git clone https://github.com/Aslemammad/vitext.git
$ cd vitext/packages/examples/intro
$ npm install
$ npm run dev

image

$ npm install tslib
$ npm run dev

Open the browser and see the same (or very similar error):

image

$ node --version
v16.8.0
$ uname -a
Linux ram 5.13.13-arch1-1 #1 SMP PREEMPT Thu, 26 Aug 2021 19:14:36 +0000 x86_64 GNU/Linux

Still does not work for me

frol avatar Sep 01 '21 11:09 frol

OH, I think you need to do yarn install on the root (vitext dir & not vitext/packages/vitext) first because it's a yarn monorepo!

Aslemammad avatar Sep 01 '21 17:09 Aslemammad

Still does not work:

$ git clone https://github.com/Aslemammad/vitext.git
$ cd vitext
$ yarn

image

image

$ yarn run dev

image

frol avatar Sep 02 '21 09:09 frol

That's really weird! Since I cannot reproduce the error, could you debug it if you're interested? You need to check the resolveId/load functions in the plugin.ts files.

BTW, why does the error shows `import p from './@vitext/_app'? because I changed it from a simple import to a dynamic import in the latest release! Link

Aslemammad avatar Sep 02 '21 19:09 Aslemammad

@Aslemammad Here is the Dockerfile to reporduce the issue:

FROM node

RUN git clone https://github.com/Aslemammad/vitext.git
RUN cd vitext && \
    yarn && \
    cd packages/examples/intro && \
    yarn

WORKDIR /vitext/packages/examples/intro
CMD ["yarn", "dev", "--host"]
$ docker build --tag vitext-intro-example
$ docker run -it --rm -p 3000:3000 vitext-intro-example

frol avatar Sep 18 '21 14:09 frol