denoland / denoland/deploy_feedback

[Bug]: Import JSON file from npm specifier.

Open
#543 1 comment 2 reactions 0 assignees View on GitHub
bug
Dominant language
No language data
Stars
79
Forks
5
PR merge metrics
No merged PRs in 30d

Description

### Problem description

Importing a JSON file from npm specifier package works locally but not in deno deploy.

### Steps to reproduce

1. Add import of json file using npm specifier.
2. When uploading to Deno Deploy/playground this error occurs: `{"type":"error","code":"deploymentFailed","ctx":"The deployment failed: BOOT_FAILURE\n\nExpected a \"JSON\" module but loaded a \"JavaScript\" module."}`

### Expected behavior

json import in deno deploy should work the same way it does locally.

### Environment

Local env where import works is:
deno 1.38.1 (release, x86_64-unknown-linux-gnu)
v8 12.0.267.1
typescript 5.2.2

### Possible solution

_No response_

### Additional context

Using esm.sh instead of npm specifier does work.

I prepared a playground with simplified code to reproduce the issue.
https://dash.deno.com/playground/cova-pg

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked Deno Deploy playground and reproduce the failure by importing a JSON file through an npm specifier. Compare that deployment with the working esm.sh version; done means the npm-specifier JSON import deploys successfully and behaves like the local run.

Written by the indexing model from the issue text.

Assessment

Tech stack
deno
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.