weiran-zsd / dts-cli

Zero-config CLI for TypeScript package development
MIT License
442 stars 23 forks source link

Running example folder with yarn start produces an error with a fresh created project #187

Closed leobastiani closed 1 year ago

leobastiani commented 1 year ago

Current Behavior

npx dts-cli create mylib
cd mylib/example
yarn
yarn start
[plugin:vite:esbuild] Transform failed with 6 errors:
/Users/leonardo.bastiani/mylib/example/index.tsx:7:14: ERROR: Duplicate "__self" prop found:
/Users/leonardo.bastiani/mylib/example/index.tsx:7:28: ERROR: Duplicate "__source" prop found:
/Users/leonardo.bastiani/mylib/example/index.tsx:12:13: ERROR: Duplicate "__self" prop found:
/Users/leonardo.bastiani/mylib/example/index.tsx:12:27: ERROR: Duplicate "__source" prop found:
/Users/leonardo.bastiani/mylib/example/index.tsx:20:21: ERROR: Duplicate "__self" prop found:
...
/Users/leonardo.bastiani/mylib/example/index.tsx:8:8
Duplicate "__self" prop found:
5  |  import { Thing } from '../.';
6  |  const App = () => {
7  |    return <div __self={this} __source={{
   |                ^
8  |      fileName: _jsxFileName,
9  |      lineNumber: 8,

Duplicate "__source" prop found:
5  |  import { Thing } from '../.';
6  |  const App = () => {
7  |    return <div __self={this} __source={{
   |                              ^
8  |      fileName: _jsxFileName,
9  |      lineNumber: 8,

Duplicate "__self" prop found:
10 |      columnNumber: 5
11 |    }}>
12 |        <Thing __self={this} __source={{
   |               ^
13 |        fileName: _jsxFileName,
14 |        lineNumber: 9,

Duplicate "__source" prop found:
10 |      columnNumber: 5
11 |    }}>
12 |        <Thing __self={this} __source={{
   |                             ^
13 |        fileName: _jsxFileName,
14 |        lineNumber: 9,

Duplicate "__self" prop found:
18 |  };
19 |  _c = App;
20 |  ReactDOM.render(<App __self={this} __source={{
   |                       ^
21 |    fileName: _jsxFileName,
22 |    lineNumber: 14,

Duplicate "__source" prop found:
18 |  };
19 |  _c = App;
20 |  ReactDOM.render(<App __self={this} __source={{
   |                                     ^
21 |    fileName: _jsxFileName,
22 |    lineNumber: 14,
    at failureErrorWithLog (/Users/leonardo.bastiani/mylib/example/node_modules/esbuild/lib/main.js:1636:15)
    at /Users/leonardo.bastiani/mylib/example/node_modules/esbuild/lib/main.js:837:29
    at responseCallbacks.<computed> (/Users/leonardo.bastiani/mylib/example/node_modules/esbuild/lib/main.js:697:9)
    at handleIncomingPacket (/Users/leonardo.bastiani/mylib/example/node_modules/esbuild/lib/main.js:752:9)
    at Socket.readFromStdout (/Users/leonardo.bastiani/mylib/example/node_modules/esbuild/lib/main.js:673:7)
    at Socket.emit (node:events:512:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23
Click outside or fix the code to dismiss.
You can also disable this overlay by setting server.hmr.overlay to false in vite.config.js.
aladdin-add commented 1 year ago

Duplicate of #186 ?

leobastiani commented 1 year ago

Oh no, they are different bugs I also don't think that downgrading typescript solves this one

aladdin-add commented 1 year ago

is this still an issue with dts-cli v2?

leobastiani commented 1 year ago

yeah, seems like a different issue now running with 2.0.1

image
[plugin:vite:esbuild] Transform failed with 6 errors:
/Users/leonardo.bastiani/react-with-hoc/example/index.tsx:7:14: ERROR: Duplicate "__self" prop found:
/Users/leonardo.bastiani/react-with-hoc/example/index.tsx:7:28: ERROR: Duplicate "__source" prop found:
/Users/leonardo.bastiani/react-with-hoc/example/index.tsx:12:13: ERROR: Duplicate "__self" prop found:
/Users/leonardo.bastiani/react-with-hoc/example/index.tsx:12:27: ERROR: Duplicate "__source" prop found:
/Users/leonardo.bastiani/react-with-hoc/example/index.tsx:20:21: ERROR: Duplicate "__self" prop found:
...
/Users/leonardo.bastiani/react-with-hoc/example/index.tsx:8:8
Duplicate "__self" prop found:
5  |  import { Thing } from '../.';
6  |  const App = () => {
7  |    return <div __self={this} __source={{
   |                ^
8  |      fileName: _jsxFileName,
9  |      lineNumber: 8,

Duplicate "__source" prop found:
5  |  import { Thing } from '../.';
6  |  const App = () => {
7  |    return <div __self={this} __source={{
   |                              ^
8  |      fileName: _jsxFileName,
9  |      lineNumber: 8,

Duplicate "__self" prop found:
10 |      columnNumber: 5
11 |    }}>
12 |        <Thing __self={this} __source={{
   |               ^
13 |        fileName: _jsxFileName,
14 |        lineNumber: 9,

Duplicate "__source" prop found:
10 |      columnNumber: 5
11 |    }}>
12 |        <Thing __self={this} __source={{
   |                             ^
13 |        fileName: _jsxFileName,
14 |        lineNumber: 9,

Duplicate "__self" prop found:
18 |  };
19 |  _c = App;
20 |  ReactDOM.render(<App __self={this} __source={{
   |                       ^
21 |    fileName: _jsxFileName,
22 |    lineNumber: 14,

Duplicate "__source" prop found:
18 |  };
19 |  _c = App;
20 |  ReactDOM.render(<App __self={this} __source={{
   |                                     ^
21 |    fileName: _jsxFileName,
22 |    lineNumber: 14,
    at failureErrorWithLog (/Users/leonardo.bastiani/react-with-hoc/example/node_modules/esbuild/lib/main.js:1636:15)
    at /Users/leonardo.bastiani/react-with-hoc/example/node_modules/esbuild/lib/main.js:837:29
    at responseCallbacks.<computed> (/Users/leonardo.bastiani/react-with-hoc/example/node_modules/esbuild/lib/main.js:697:9)
    at handleIncomingPacket (/Users/leonardo.bastiani/react-with-hoc/example/node_modules/esbuild/lib/main.js:752:9)
    at Socket.readFromStdout (/Users/leonardo.bastiani/react-with-hoc/example/node_modules/esbuild/lib/main.js:673:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23
Click outside or fix the code to dismiss.
You can also disable this overlay by setting server.hmr.overlay to false in vite.config.js.
aladdin-add commented 1 year ago

A big thanks ❤️ ! should be addressed in v2.0.2: https://github.com/weiran-zsd/dts-cli/releases/tag/v2.0.2

leobastiani commented 1 year ago

Thank you ❤️