parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.47k stars 2.27k forks source link

Cannot find module '3wmTv' when importing from index file #9128

Closed ankur-shipa closed 3 months ago

ankur-shipa commented 1 year ago

🐛 bug report

When importing from index file, bundle generated via parcel gives error Cannot find module '3wmTv'

molecule/Loader/Loader.ts

export Loader = {}

molecule/Loader/index.ts

export { Loader } from './Loader'

molecule/Select/Select.ts

import { Loader } from 'molecule/Loader'  // **Gives error `Cannot find module '3wmTv'`**

import { Loader } from 'molecule/Loader/Loader' // **works fine**

🤔 Expected Behavior

import from index file should work

import { Loader } from 'molecule/Loader' 

🌍 Your Environment

Software Version(s)
Parcel 2.8.3
Node 18.12.1
npm/Yarn Yarn 1.22.19
Operating System Windows, Linux, Mac
mischnic commented 9 months ago
  1. How do you even import molecule? Is it a separate package?
  2. With your sourcecode, I get

    @parcel/transformer-js: Expected '{', got 'Loader'
    
    > 1 | export Loader = {}
    >   |        ^^^^^^
    
github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.