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

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

Open
frederikhors opened this issue Apr 13, 2019 · 0 comments
Open

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

frederikhors opened this issue Apr 13, 2019 · 0 comments

Comments

@frederikhors
Copy link

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?

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