material-design-lite
material-design-lite copied to clipboard
Uncaught SyntaxError: Unexpected token <
Bugs
Please include the following information with your bug report:
What MDL Version are you using? (please be specific, e.g. major.minor.patch) "material-design-lite": "^1.3.0"
What browser(s) is this bug affecting (including version)? Google Chrome Version 67.0.3396.99 (Official Build) (64-bit)
What OS (and version) are you using? MacOS high sierra 10.13.5
What are the steps to reproduce the bug? Can you create a plunker/codepen/jsfiddle which reproduces it?
Follow the installation step given at https://getmdl.io/started/index.html
NPM Simply install Material Design Lite files in your npm enabled project using:
Run the following command in a shell:
npm install material-design-lite --save
This will install the Material Design Lite library files in your project's node_modules folder.
Refer to these files by adding a and a
<link rel="stylesheet" href="/node_modules/material-design-lite/material.min.css">
<script src="/node_modules/material-design-lite/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
What is the expected behavior? Should work Properly
What is the actual behavior? Error Uncaught SyntaxError: Unexpected token < material.min.js:1
Hi @rajatdhoot123, I'm unable to reproduce your issue.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="node_modules/material-design-lite/material.min.css">
<script src="node_modules/material-design-lite/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>
</body>
</html>
Im encountering the same issue. Im not able to use mdl at all because of this error. Im using react 16.7 with hooks etc. When i use the hosted approach for mdl, the style is applied but non of the js is working. Any ideas if there are issues with the new version of react?
Do you use webpack or how are the files served?
I am also seeing this issue with installing MDL. MDL does not show a console error when using the hosted version however.. I am using webpack, just to setup a simple vue template.