Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] error importing files from a folder starting with . since v3.1.0 #2961

Closed
4 tasks done
johlrich opened this issue Mar 22, 2021 · 4 comments · Fixed by #2962
Closed
4 tasks done

[BUG] error importing files from a folder starting with . since v3.1.0 #2961

johlrich opened this issue Mar 22, 2021 · 4 comments · Fixed by #2962
Assignees
Labels
bug Something isn't working

Comments

@johlrich
Copy link

Bug Report Quick Checklist

  • I am on the latest version of Snowpack & all plugins.
  • I use package manager yarn (Fill in: npm, yarn, pnpm, etc).
  • I run Snowpack on OS windows (Fill in: Windows, Mac, Linux, etc).
  • I run Snowpack on Node.js v12+

Describe the bug

Files are no longer found when imported from a folder that begins with . inside of the src folder

To Reproduce

  1. npm init snowpack-app --template @snowpack/app-template-svelte
  2. Add a file in a folder that starts with a dot to the src folder, something like /src/.test/hello.js
  3. import file from another js/svelte file like `src
  4. run build
  5. See error! [13:55:08] [snowpack] Error: Not Found (/dist/.test/hello.js)

Expected behavior

A clear and concise description of what you expected to happen.

Anything else?

This was working in 3.0.13

If you change the above subfolder name from .test to _test then everything works.

Repro repo setup here: https://github.com/johlrich/snowpack-import-repro

@matthewp matthewp self-assigned this Mar 22, 2021
@matthewp
Copy link
Contributor

This is a regression caused by #2912 . Checking to see what the best way to fix.

@matthewp matthewp added the bug Something isn't working label Mar 22, 2021
@matthewp
Copy link
Contributor

@FredKSchott It doesn't appear that excluding . folders was done intentionally as part of that issue. If so I can fix this by removing that code.

@FredKSchott
Copy link
Owner

Good catch, we thought that this was already the default behavior since glob excludes dotfiles by default. But it looks like .dotfile/* directories were actually still included by default.

We were just trying to match existing behavior using the new fdir library, so the intention here was zero breaking changes. @matthewp if you can see how to fix, lets go ahead and do that.

matthewp added a commit that referenced this issue Mar 22, 2021
This prevents folders that start with a `.` from being excluded from being imported by modules.

Fixes #2961
@matthewp
Copy link
Contributor

#2962

matthewp added a commit that referenced this issue Mar 30, 2021
This prevents folders that start with a `.` from being excluded from being imported by modules.

Fixes #2961
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants