material-design-lite icon indicating copy to clipboard operation
material-design-lite copied to clipboard

Uncaught SyntaxError: Unexpected token <

Open rajatdhoot123 opened this issue 7 years ago • 4 comments
trafficstars

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

rajatdhoot123 avatar Jul 18 '18 08:07 rajatdhoot123

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>

HZooly avatar Aug 03 '18 14:08 HZooly

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?

jp3492 avatar Nov 21 '18 14:11 jp3492

Do you use webpack or how are the files served?

aburai avatar Nov 21 '18 15:11 aburai

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.

Arro94 avatar Jan 11 '19 00:01 Arro94