Tips
Error: npm run register
Error when register.js
cannot be executed, regardless of the success or failure of command registration.
Please consider the following modifications. (Either one or a combination)
- package.json
"type": "module",
- tsconfig.json
"moduleResolution": "Node",
"moduleResolution": "Bundler",
- register.ts
- Add
.js
when importing from other files
import { commands } from './commands.js'
- Add
- esbuild etc.
- Use a bundling tool to compile
register.js
into a single file
- Use a bundling tool to compile
This error means that you need to take into account that the code index.ts
to be deployed and the code register.ts
to be registered are executed in different environments.
Tips for various environments (β)
Hono
- Browser
https://YOUER_DOMAIN.com
-> Display:Hono World
- Discord Bot
/hello
-> Response:Discord World
- Discord Interaction Endpoint
- Register URL:
https://YOUER_DOMAIN.com/interaction
- Register URL: