qwik icon indicating copy to clipboard operation
qwik copied to clipboard

fix(dev): path handling in dev

Open wmertens opened this issue 1 year ago • 6 comments

Fixes #7135

Before merging:

  • [ ] test on windows, I can't do it. Just running pnpm docs.dev and alt-clicking a component to open in editor should work.

wmertens avatar Dec 19 '24 21:12 wmertens

🦋 Changeset detected

Latest commit: 4bb9dbea694770ff308f8c5c2e7a02e1e78544f6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@builder.io/qwik Patch
eslint-plugin-qwik Patch
@builder.io/qwik-city Patch
create-qwik Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Dec 19 '24 21:12 changeset-bot[bot]

Hey Wout, Just came across this PR this morning.

Excerpt URL from Windows OS. There's an extra src (%2Fsrc%2F) in here which is causing it to fail. If I remote the extra src it works fine, and opens in VSCode as expected.

docs%2Fsrc%2F%2Fsrc%2Fcomponents%2Fheader%2Fheader.tsx%3A63%3A11

Shane-Donlon avatar Mar 02 '25 13:03 Shane-Donlon

@Shane-Donlon thanks! Looks like a problem with normalizing, hmm

wmertens avatar Mar 02 '25 13:03 wmertens

Hey Wout, a little bit of digging around. Seems the problem was with string concatenation on the fetch request.

https://github.com/QwikDev/qwik/blob/main/packages/qwik/src/optimizer/src/plugins/click-to-component.html#L151

image

Possible edit: Works fine on Windows (full disclosure haven't tested on Linux but can do) image

Shane-Donlon avatar Mar 03 '25 11:03 Shane-Donlon

Hmm ok I'll take a look. I'm not really liking that workaround, it's complex and we don't know where else things are failing

wmertens avatar Mar 03 '25 12:03 wmertens

Hmm ok I'll take a look. I'm not really liking that workaround, it's complex and we don't know where else things are failing

Yeah I get that. Although the last bit of digging around.

https://github.com/QwikDev/qwik/blob/main/packages/qwik/src/optimizer/src/plugins/vite-dev-server.ts#L231

If I change that line to the below it also works fine too (without having to do the string manipulation above)

END_SSR_SCRIPT(opts, opts.rootDir ? opts.rootDir : path.join(opts.rootDir, 'src'))

opts.srcDir included the "src" whereas opts.rootDir has the "src" omitted and works fine. Regardless just let me know whenever things are ready for testing.

Shane-Donlon avatar Mar 03 '25 13:03 Shane-Donlon

#7785 is fixing it. I close this one. Thanks for your commitment.

gioboa avatar Aug 07 '25 09:08 gioboa