vitext
vitext copied to clipboard
Intro Example should not be broken
I tried intro example and bumped into a few problems:
- vitext 0.0.1 is deleted, so I had to update it to
0.0.2
in theintro/package.json
- next,
npm run dev
failed to start due to:Error: Cannot find module 'react-refresh/cjs/react-refresh-runtime.development.js'
. I Resolved it withnpm add -D react-refresh
- 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:
Environment:
- Arch Linux, x86-64
- node.js 16.6.1
- npm 7.20.5
- vitext example from master branch
P.S. Cool project! :+1:
Thank you @frol, That's really helpful. I'll fix it soon.
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 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
$ npm install tslib
$ npm run dev
Open the browser and see the same (or very similar error):
$ 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
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!
Still does not work:
$ git clone https://github.com/Aslemammad/vitext.git
$ cd vitext
$ yarn
$ yarn run dev
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 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