LivelyKernel / LivelyKernel/lively4-core

Importing npm modules as browserified js files works from an absolute path but not from a relative path

Open
#404 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
89
Forks
25
PR merge metrics
No merged PRs in 30d

Description

`

import mp from "./npm-modules/npm-mouse-position.js"
import mp2 from "https://lively-kernel.org/lively4/BP2019RH1/scratch/individualsAsPoints/regl/npm-modules/npm-mouse-position.js"

"mp:" + mp + " mp3: " + mp2
`

Gives this result when evaluated on a folder with an npm-modules subfolder which holds the nom-mouse-position.js file which can be found at https://lively-kernel.org/lively4/BP2019RH1/scratch/individualsAsPoints/regl/npm-modules/npm-mouse-position.js.

![image](https://user-images.githubusercontent.com/34538290/76340147-617b3800-62fb-11ea-8594-448d2d1e8d8e.png)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue using the embedded script and the folder containing npm-modules/npm-mouse-position.js, comparing the relative import with the absolute URL shown in the report. Trace the browserified module loading path used for both cases. Done means the relative and absolute imports evaluate successfully in the same example.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.