You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
when the custom-server-express-typescript example is downloaded from official examples, the command yarn dev / npm run dev doesn't work. the dist folder isn't found.
> $ yarn dev
yarn run v1.22.4
warning package.json: No license field
$ nodemon --exec ts-node src/server.ts
[nodemon] 2.0.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: ts,json
[nodemon] starting `ts-node src/server.ts`
(node:14189) UnhandledPromiseRejectionWarning: Error: Cannot find module './dist'
Require stack:
- /home/syta/Downloads/bottender/examples/custom-server-express-typescript/index.js
- /home/syta/Downloads/bottender/examples/custom-server-express-typescript/node_modules/bottender/dist/server/Server.js
- /home/syta/Downloads/bottender/examples/custom-server-express-typescript/node_modules/bottender/dist/bottender.js
- /home/syta/Downloads/bottender/examples/custom-server-express-typescript/node_modules/bottender/dist/index.js
- /home/syta/Downloads/bottender/examples/custom-server-express-typescript/src/server.ts
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/syta/Downloads/bottender/examples/custom-server-express-typescript/index.js:1:18)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
(node:14189) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:14189) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[nodemon] clean exit - waiting for changes before restart
Expected behavior
The npm dev command transpiles the typescript code and executes the developer server normally, when a change in a file is made, the server reloads automatically, compiles/transpiles too, and listen in the default port.
Additional context
A workaround exist: Bottender expects npx bottender dev to be executed at least one time to generate dist folder but you lost all "hot reload" capabilities doing this, the dev server makes useless.
The actual configuration in Bottender using in a typescript project doesn't permit to avoid the "dual" workflow of use a dist transpiled folder configured as a import in index.js and a "core" typescript project using ts-node.
The text was updated successfully, but these errors were encountered:
sytabaresa
changed the title
custom-server-express-typescript example doesn't work
hot reload and initial compilation in a typescript project doesn't work (official example)
Aug 23, 2020
sytabaresa
changed the title
hot reload and initial compilation in a typescript project doesn't work (official example)
hot reload and initial compilation in a custom server typescript project doesn't work (official example)
Aug 23, 2020
Describe the bug
when the custom-server-express-typescript example is downloaded from official examples, the command
yarn dev
/npm run dev
doesn't work. thedist
folder isn't found.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The npm dev command transpiles the typescript code and executes the developer server normally, when a change in a file is made, the server reloads automatically, compiles/transpiles too, and listen in the default port.
Additional context
npx bottender dev
to be executed at least one time to generatedist
folder but you lost all "hot reload" capabilities doing this, the dev server makes useless.dist
transpiled folder configured as a import inindex.js
and a "core" typescript project usingts-node
.The text was updated successfully, but these errors were encountered: