Typescript is not compiled
See original GitHub issueDescribe 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
orwmr 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:
- Created a year ago
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.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