I've found an issue with relative paths imports - import {BLAH} from '.' and import {BLAH} from '..' do not work as expected, however import {BLAH} from './' and import {BLAH} from '../'do work correctly.
It seems this was a problem in 3.0.x too, however 3.0.x compiled and served the file with incorrect content and the error occured at runtime. However in the 3.1.0-pre.11 the file with problematic code now returns a 500 error, with an unhelpful error message.
Bug Report Quick Checklist
Describe the bug
Extracted from https://github.com/snowpackjs/snowpack/pull/2707#issuecomment-790926970, so it doesn't get lost.
I've found an issue with relative paths imports -
import {BLAH} from '.'
andimport {BLAH} from '..'
do not work as expected, howeverimport {BLAH} from './'
andimport {BLAH} from '../'
do work correctly.It seems this was a problem in 3.0.x too, however 3.0.x compiled and served the file with incorrect content and the error occured at runtime. However in the 3.1.0-pre.11 the file with problematic code now returns a 500 error, with an unhelpful error message.
Reproduction is available here.
Given the input (found in this file)
In 3.0.x it compiles to the incorrect output:
In 3.1.0-pre.11 it errors during compile:
To Reproduce
Reproduction is available here.
Clone that repo, move into the
bare-relative-import
subfolder and runnpm install
andnpm start
Expected behavior
I would expect the code:
to compile to: