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

content-tag failing with HMR api used inside gts/gjs; #60

Open
lifeart opened this issue Jan 12, 2024 · 1 comment
Open

content-tag failing with HMR api used inside gts/gjs; #60

lifeart opened this issue Jan 12, 2024 · 1 comment

Comments

@lifeart
Copy link

lifeart commented Jan 12, 2024

stack trace:

one/Table.gts:10:7: 10:14
10:14:48 AM [vite] Internal server error: Parse Error at /Users/lifeart/Repos/glimmer-next/src/components/pages/page-one/Table.gts:10:7: 10:14
  Plugin: glimmer-next
  File: /Users/lifeart/Repos/glimmer-next/src/components/pages/page-one/Table.gts
      at module.exports.__wbg_Error_58015c683709e145 (/Users/lifeart/Repos/glimmer-next/node_modules/.pnpm/[email protected]/node_modules/content-tag/pkg/node/content_tag.cjs:294:17)
      at wasm://wasm/004e9cce:wasm-function[179]:0x6063b
      at wasm://wasm/004e9cce:wasm-function[396]:0x8dcc6
      at Preprocessor.process (/Users/lifeart/Repos/glimmer-next/node_modules/.pnpm/[email protected]/node_modules/content-tag/pkg/node/content_tag.cjs:238:18)
      at TransformContext.transform (file:///Users/lifeart/Repos/glimmer-next/vite.config.mts.timestamp-1705043533982-c0ee68bce3b52.mjs:977:32)
      at Object.transform (file:///Users/lifeart/Repos/glimmer-next/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-uAHLeuC6.js:63685:62)
      at loadAndTransform (file:///Users/lifeart/Repos/glimmer-next/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-uAHLeuC6.js:49384:51)
      at async viteTransformMiddleware (file:///Users/lifeart/Repos/glimmer-next/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-uAHLeuC6.js:59005:32)

code sample:

export const Table = <template>
  <div></div>
</template>;

if (import.meta.hot) {
  import.meta.hot.accept((newModule) => {
    console.log('updated: count is now ', Object.keys(newModule));
    if (newModule) {
      console.log('updated: count is now ', newModule
      console.log('updated: count is now ', newModule.count);
    }
  });
}
@lifeart
Copy link
Author

lifeart commented Jan 12, 2024

ah, it seems failing because console.log('updated: count is now ', newModule is incorrect line, keeping issue here to figure out should be syntax error tolerant here (if it's not inside `)

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