Replies: 2 comments 2 replies
-
Hey, thanks for reporting this issue. Could you please provide the minimal files to reproduce this error? Thanks |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi thanks for the fast response! For the React component I'm using a default Vite setup with the following: // Vite specific 'raw' import to return file as a string
import server from './fastify/server.js?raw'
<Sandpack
customSetup={{
dependencies: {
"fastify": "latest"
},
entry: "./fastify/server.js"
}}
files={{
'./fastify/server.js': server
}}
/> The Node.js script for Fastify is: import Fastify from 'fastify'
const start = async function () {
const fastify = Fastify()
fastify.get('/', async () => {
return { hello: 'world' }
})
try {
await fastify.listen({ host: '127.0.0.1', port: 3000 })
} catch (err) {
fastify.log.error(err)
process.exit(1)
}
}
start() |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently trying to run Fastify inside of Sandpack. I've added the required dependencies but get this error:
What I don't understand is that Fastify (or the script I'm using) does not require the dns module.
But when I add the required 'dns' package I get the following errors:
Does anyone have any idea why this could be happening or point me in the right direction?
@simoneb
Beta Was this translation helpful? Give feedback.
All reactions