question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript is not compiled

See original GitHub issue

Describe the bug yarn create wmr rename public\index.js to public\index.tsx

- export async function prerender(data) {
+ export async function prerender(data: JSX.IntrinsicAttributes) {
	return await ssr(<App {...data} />);
}

then:

500 ./public\index.js - Unexpected token (./index.js:27:37)

  25 | hydrate(<App />);
  26 |
> 27 | export async function prerender(data: JSX.IntrinsicAttributes) {
     |                                     ^
  28 |   return await ssr(<App {...data} />);
  29 | }

Bug occurs with:

  • wmr or wmr start (development)
  • wmr serve
  • wmr build (production)

Desktop (please complete the following information):

  • Node Version: 17
  • WMR Version: newest

Additional context Does this mean we need to enable @rollup/plugin-typescript ourselves?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rschristiancommented, Apr 12, 2022

Interesting. @ does have some special meaning, so that could present an issue, but I’m also having an issue with using ~ which is in our docs. I’ll look into this soon, thanks for bringing it up.

1reaction
rschristiancommented, Apr 11, 2022

Not a bug, just a feature that hasn’t yet been released. #875 has been merged in, though.

Use aliases in your wmr.config instead. https://wmr.dev/docs/configuration#aliasing-and-path-mappings

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript files not compiled to javascript files in website ...
I rebuilt the project and ran it however no .js files are being created. I am using Typescript 2.0.3. I see 'BuildOnSave..' messages...
Read more >
TS does not compile .ts files #32326 - microsoft/TypeScript
TS doesn't compile files ... Actual behavior: Nothing happens. .js version is not created. $ npm run tsc > ts2@1.0.0 tsc /Users/ ...
Read more >
TypeScript Compiling with Visual Studio Code
Compiling TypeScript. TypeScript is a typed superset of JavaScript that transpiles to plain JavaScript. It offers classes, modules, and interfaces to help ...
Read more >
Compiling TypeScript into JavaScript - JetBrains Rider
Compilation is invoked with the Compile actions from the TypeScript widget on the Status toolbar as described in Compile TypeScript code below.
Read more >
How to compile a Typescript file ? - GeeksforGeeks
Typescript file does not run directly on the browser as javascript run, we have to compile the typescript file to the javascript then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found