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

HMR (unstable_dev in 1.16.0) loses TypeScript sourcemap support #6392

Closed
1 task done
barrymay opened this issue May 15, 2023 · 8 comments · Fixed by #6762
Closed
1 task done

HMR (unstable_dev in 1.16.0) loses TypeScript sourcemap support #6392

barrymay opened this issue May 15, 2023 · 8 comments · Fixed by #6762

Comments

@barrymay
Copy link

barrymay commented May 15, 2023

What version of Remix are you using?

1.16.0

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

FYI - This was found when trying to see emotion work under Remix HMR/HDR (which it does! 😀) but when trying to debug a related issue, I saw this which makes the investigation harder.

Show the Proper behavior (by default)

  • Clone https://github.com/barrymay/remix-examples.git (my fork of remix-run/examples)
  • Open VSCode (or whatever IDE) under the emotion folder
  • Go to branch Test-HMR-on-latest-libraries
  • run npm install (updates to latest react/remix/emotion) and npm run dev
  • In the browser that opens, the app will work as expected w/o HMR support
  • In Chrome DevTools, hit Cmd-P and navigate to index.tsx (under /app/routes)
  • You'll see the expected typescript representation and be able to debug with it (PASS)

Add HMR and show the failing behavior

  • Open remix.config.js, and uncomment
  future: {
    unstable_dev: true
  }, 
  • Run npm run dev
  • App will start, HMR/HDR will work great
  • In Chrome Devtools, hit Cmd-P and navigate to index.tsx
  • The JS representation is shown in the source files (it's kinda hard to find in the first place)

Expected Behavior

The TypeScript sourcemaps should be respected as they are without HMR on.

Actual Behavior

The TypeScript sourcemaps are not represented properly and only the underlying JS (and more) is shown.

@tgds
Copy link

tgds commented Jun 19, 2023

Same here. No sourcemaps. I'm on 1.17.0

@WesleyYue
Copy link

Can confirm it occurs in 1.18.0 as well under v2_dev

@barrymay
Copy link
Author

barrymay commented Jul 3, 2023

Tried today on 1.18.1, with a barebones create-remix app, and sadly same issue. For developer efficiency, TS sourcemaps are a critical browser feature for debuggability of an app, so I can't move to remix DEV mode until this is sorted.

@pcattori pcattori self-assigned this Jul 3, 2023
@pcattori pcattori linked a pull request Jul 3, 2023 that will close this issue
2 tasks
@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

🤖 Hello there,

We just published version v0.0.0-nightly-da44482-20230706 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions github-actions bot closed this as completed Jul 6, 2023
@bmaycc
Copy link

bmaycc commented Jul 6, 2023

Tested the nightly with my example - looks great @pcattori, thanks !

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.19.0-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.19.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@jgentes
Copy link

jgentes commented Sep 3, 2023

I'm still seeing broken sourcemaps in 1.19.3. My remix.config.js (setup for Cloudflare Pages):

/** @type {import('@remix-run/dev').AppConfig} */
export default {
	ignoredRouteFiles: ['**/.*'],
	server: './server.ts',
	serverBuildPath: 'functions/[[path]].js',
	serverConditions: ['workerd', 'worker', 'browser'],
	serverDependenciesToBundle: 'all',
	serverMainFields: ['browser', 'module', 'main'],
	serverMinify: true,
	serverModuleFormat: 'esm',
	serverPlatform: 'neutral',
	serverNodeBuiltinsPolyfill: {},
	future: {
		v2_dev: true,
		v2_routeConvention: true,
		v2_errorBoundary: true,
		v2_meta: true,
		v2_normalizeFormMethod: true,
		v2_headers: true
	}
}

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

Successfully merging a pull request may close this issue.

7 participants