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

Breaks if component filename contains ? #49

Open
taylor-hunt-kr opened this issue Feb 18, 2021 · 0 comments
Open

Breaks if component filename contains ? #49

taylor-hunt-kr opened this issue Feb 18, 2021 · 0 comments

Comments

@taylor-hunt-kr
Copy link

  • @marko/webpack version: 7.0.0-2
  • Environment: Node 14.15.4 on MacOS

I was using a filesystem-based router that supports querystring parameters.

If I had to guess, the ? in the filename conflicts with Webpack’s old-fashioned loader syntax.

Steps to Reproduce

  1. Name a .marko file with ? somewhere in it. I had ?search.marko.

  2. Attempt to bundle it — I was using it as a route entry point, so it was imported from a .js file.

  3. Behold:

    ERROR in ./routes/_router.js 19:0-36
    Module not found: Error: Can't resolve './?search.marko?assets' in '~/repo/routes'
     @ ./index.js 4:0-40 24:11-24
    

And if you think ?param.marko is goofy…

The Marko compiler gets confused if the standard directory/index.ext convention is used, since it supports component-name/index.marko. As a result, this router instead has the convention of directory/.marko.

You might be pleasantly surprised to learn that works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant