Asaf
Asaf7mo ago

deployctl error: TypeError: request or response body error

Hey, I'm getting an error when trying to deploy to a project error: TypeError: request or response body error: error reading a body from connection: stream error received: unexpected internal error encountered It stucks on ⠴ Deploying... (100.0%) and after sometime it throw the error I mentioned above I created new project and this is my file
import { emojify } from 'npm:node-emoji@2';

Deno.serve(() => new Response(emojify(':t-rex: :heart: NPM')));
import { emojify } from 'npm:node-emoji@2';

Deno.serve(() => new Response(emojify(':t-rex: :heart: NPM')));
It was working great yesterday, anyone can assist? I've noticing its not working whenever I specify a npm module import
2 Replies
Deno AI Helper
Deno AI Helper7mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the error message and the code snippet you've provided, it seems like there might be an issue with the way the npm module is being imported or used within Deno. In your code snippet, you are using an npm package with Deno, which is generally supported through the use of the npm: namespace. However, it's important to note that not all npm packages are fully compatible with Deno, especially if they rely on Node.js-specific APIs that are not available in Deno. Here's a potential issue I spotted in your code:
import { emojify } from 'npm:node-emoji@2';

Deno.serve(() => new Response(emojify(':t-rex: :heart: NPM')));
import { emojify } from 'npm:node-emoji@2';

Deno.serve(() => new Response(emojify(':t-rex: :heart: NPM')));
While the import statement itself seems syntactically correct for using npm packages in Deno, the error you're encountering might be related to the compatibility of the node-emoji package with Deno. It's possible that node-emoji or one of its dependencies is using Node.js-specific features that are causing the error during deployment. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice. Additionally, you might want to look for alternative emoji libraries that are known to be compatible with Deno, or consider using Deno's built-in modules and features to achieve similar functionality without relying on npm packages. If the issue persists, you may want to reach out to the Deno community for further assistance or check if there are any known issues with the npm package you are trying to use.
razzi
razzi7mo ago
Mine spun for a few seconds but it eventually did deploy https://healthy-whale-46-n379ew7zht5s.deno.dev/ I noticed this line in the build
Uploading all files from the current dir
so maybe it's other files that are the problem? In my case I only have one file with the js you posted