Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Intro Example should not be broken #10

Open
frol opened this issue Aug 8, 2021 · 7 comments
Open

Intro Example should not be broken #10

frol opened this issue Aug 8, 2021 · 7 comments

Comments

@frol
Copy link

frol commented Aug 8, 2021

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! 👍

@Aslemammad
Copy link
Owner

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

Aslemammad added a commit that referenced this issue Aug 31, 2021
* remove: rollup-plugin-esbuild

* feat: new rollup config

* fix: eslint warnings

* fix: removing esbuild-rollup completely

* fix: add (skip) tests

* fix: fix Document error

* fix: add new item to .gitignore

* fix: handle no Script

* fix: build

* fix: resolve fsp

* fix: something

* feat: add codesandbox

* fix: resolve react-dom/server

* fix: resolve js extension

* fix: something

* fix: app component

* fix: cjs default export

* fix: resolve cjs packages

* fix: resovle cjs packages
@Aslemammad
Copy link
Owner

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!

@frol
Copy link
Author

frol commented Sep 1, 2021

@Aslemammad Hey! I hope you are doing well now 🙏

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

@Aslemammad
Copy link
Owner

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!

@frol
Copy link
Author

frol commented Sep 2, 2021

Still does not work:

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

image

image

$ yarn run dev

image

@Aslemammad
Copy link
Owner

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

@frol
Copy link
Author

frol commented Sep 18, 2021

@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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants