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.

Problem with a SPA and owc-dev-server (--app-index)

See original GitHub issue

I’m having troubles using the default start script in package.json.

The default one is:

"start": "owc-dev-server --open ./src"

but I’m building a SPA (single page application) and I changed it to:

"start": "owc-dev-server --app-index ./src/index.html"

adding also in index.html’s <head>:

<base href="/">

But now the problem is:

<script type="module" src="./my-app.js"></script>

In browser’s console I got this error:

Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

I need to change it like this to work:

<script type="module" src="./src/my-app.js"></script>

adding ./src before /my-app.js.

The problem now is using npm run build: it doesn’t find my-app.js during build.

I’m wrong somewhere, but where?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
LarsDenBakkercommented, Jun 5, 2019

Yes indeed, I fully agree. Ive fixed the scaffold to set it up correctly now!

0reactions
LarsDenBakkercommented, Jul 17, 2019

Closing this as it’s fixed and we’re using es-dev-server now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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