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

Fix: Missing @rollup/plugin-typescript in generated projects, and a wrong path in the document #124

Merged
merged 5 commits into from
Dec 29, 2021

Conversation

igrep
Copy link
Contributor

@igrep igrep commented Dec 29, 2021

Fix the following error I encountered when running npm run build in a project generated by npm init qwik:

> npm run build

> qwik-app@0.0.1 build
> npm run clean && rollup -c

> qwik-app@0.0.1 clean
> rimraf */build/

src/index.server.tsx, src/my-app.tsx → public/build, server/build...
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
src\my-app.tsx (4:52)
2: import { qComponent, qHook, useEvent } from '@builder.io/qwik';
3:
4: export const MyApp = qComponent<{}, { name: string }>({
                                                       ^
5:   tagName: 'my-app', // optional
6:   onMount: qHook(() => ({ name: 'World' })),
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
    at error (C:\Users\igrep\Downloads\t\qwik-app\node_modules\rollup\dist\shared\rollup.js:158:30)
    at Module.error (C:\Users\igrep\Downloads\t\qwik-app\node_modules\rollup\dist\shared\rollup.js:12420:16)
    at Module.tryParse (C:\Users\igrep\Downloads\t\qwik-app\node_modules\rollup\dist\shared\rollup.js:12823:25)
    at Module.setSource (C:\Users\igrep\Downloads\t\qwik-app\node_modules\rollup\dist\shared\rollup.js:12726:24)
    at ModuleLoader.addModuleSource (C:\Users\igrep\Downloads\t\qwik-app\node_modules\rollup\dist\shared\rollup.js:22197:20)

My Environment

OS: Windows 10
Node: v16.13.1

Fix the following error I encountered when running `npm run build` in a project generated by `npm init qwik`:

```
> npm run build

> qwik-app@0.0.1 build
> npm run clean && rollup -c

> qwik-app@0.0.1 clean
> rimraf */build/

src/index.server.tsx, src/my-app.tsx → public/build, server/build...
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
src\my-app.tsx (4:52)
2: import { qComponent, qHook, useEvent } from '@builder.io/qwik';
3:
4: export const MyApp = qComponent<{}, { name: string }>({
                                                       ^
5:   tagName: 'my-app', // optional
6:   onMount: qHook(() => ({ name: 'World' })),
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
    at error (C:\Users\igrep\Downloads\t\qwik-app\node_modules\rollup\dist\shared\rollup.js:158:30)
    at Module.error (C:\Users\igrep\Downloads\t\qwik-app\node_modules\rollup\dist\shared\rollup.js:12420:16)
    at Module.tryParse (C:\Users\igrep\Downloads\t\qwik-app\node_modules\rollup\dist\shared\rollup.js:12823:25)
    at Module.setSource (C:\Users\igrep\Downloads\t\qwik-app\node_modules\rollup\dist\shared\rollup.js:12726:24)
    at ModuleLoader.addModuleSource (C:\Users\igrep\Downloads\t\qwik-app\node_modules\rollup\dist\shared\rollup.js:22197:20)
```
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

Successfully merging this pull request may close these issues.

None yet

2 participants