elysiajs / elysia

Ergonomic Framework for Humans
https://elysiajs.com
MIT License
10.25k stars 219 forks source link

error: Cannot find module "@elysiajs/html" from "…/src/index.ts" #258

Closed vinyll closed 1 year ago

vinyll commented 1 year ago

Despite following the instructions from https://elysiajs.com/plugins/html.html, I couldn't display an HTML string.

Using bun 1.0.4 and latest Elysia

Reproduce

bun create elysia app
cd app
bun add @elysiajs/html

Now Edit the src/index.ts:

import { Elysia } from 'elysia'
import { html } from '@elysiajs/html'

new Elysia()
    .use(html())
    .get( '/html', () => `<html><h1>Hello World</h1></html>` )
    .listen(8080)

And try to run bun run src/index.ts

The following error occurs:

error: Cannot find module "@elysiajs/html" from "/my/path/app/src/index.ts"

I'm new to Bun/Elysia so I may have missed something 🤔

vinyll commented 1 year ago

Nevermind, I just installed over again and fell into the magic of write-your-bug-it-will-go-away 🪄