bdkjones / CodeKit

CodeKit 3 Issue Tracker
https://codekitapp.com
82 stars 5 forks source link

Bundling failed with error #612

Open MrMooky opened 4 years ago

MrMooky commented 4 years ago

I get this message when using npm install jquery and then import $ from "jquery" within the CodeKit main js file:

Bundling failed with this error: Name must be lowercase, can contain digits, dots, dashes, "@" or spaces

Screenshot 2020-05-05 at 13 18 58

I found a bunch of entries but they all involve bower, which I am not using. As ES6 Bundle Format I use IIFE. Since I'm fairly new to ES6 modules and cannot use regular CodeKit prepend statements for newer libraries, I thought I should give ES6 modules a go, but directly stumbled upon this problem which I do not know how to fix. ._.

bdkjones commented 4 years ago

Can you upload a demo project that shows this issue so I can take a look? Thanks.

On May 5, 2020, at 04:19, Andreas Mühe notifications@github.com wrote:

 I get this message when using npm install jquery and then import $ from "jquery" within the CodeKit main js file:

Bundling failed with this error: Name must be lowercase, can contain digits, dots, dashes, "@" or spaces

I found a bunch of entries but they all involve bower. As ES6 Bundle Format I use IIFE. Since I'm fairly new to ES6 modules and cannot use regular CodeKit prepend statements for newer libraries, I though I should give ES6 modules a go, but directly stumbled upon this problem which I do not know how to fix. ._. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

MrMooky commented 4 years ago

I don't know what was happening in my old project which I tried to "modernize", but it worked in a blank project so this might be something on my end or maybe something else. I'll keep digging, but the basic modules setup works fine with CodeKit.

MrMooky commented 4 years ago

I have to re-open this. So uhm, new JS file and I still end up with the error Bundling failed with this error: Name must be lowercase, can contain digits, dots, dashes, "@" or spaces.

Basically, I did the following:

Step 1 npm install tiptap

Step 2 Pasted this code into an empty file:

import { Editor, EditorContent } from 'tiptap'

export default {
  components: {
    EditorContent,
  },
  data() {
    return {
      editor: null,
    }
  },
  mounted() {
    this.editor = new Editor({
      content: '<p>This is just a boring paragraph</p>',
    })
  },
  beforeDestroy() {
    this.editor.destroy()
  },
}

Step 3

Screenshot 2020-05-26 08 37 58

Step 4 Save and error. I don't get it. ._.

bdkjones commented 4 years ago

First, what is the name of the JS file where the code above appears?

Second, try using lowercase letters in your import statements: editor, editorContent

MrMooky commented 4 years ago

First, what is the name of the JS file where the code above appears?

The file is named backend-editor.js and it compiles to backend-editor.min.js.

Second, try using lowercase letters in your import statements: editor, editorContent

Tried that, same result as mentioned above.

I'm using the latest version of CodeKit (3.12.5) and like I said, this is a blank javascript file which is not merged with anything else.

bdkjones commented 4 years ago

Ok. Can you post a link to download a small demo project that shows the issue? I'll take a look.

MrMooky commented 4 years ago

There you go: codekit-demo.zip

I extracted the files and folder structure the way it is in my main project, but only with the relevant parts. The original project also includes composer.json, package.json, package-lock.json and phpunit.xml and I had high hopes that package-lock.json was the cause, since there is the following entry, but even without this file it is not compiling.

"lower-case": {
    "version": "1.1.4",
    "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz",
    "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=",
    "dev": true
},
bradleyDouglas commented 3 years ago

@MrMooky @bdkjones Any resolution on this? I'm experiencing the same issue. I was using a Main js file that was importing some functions from another file. That was working fine. I then NPM installed the lazysizes package. Once I did that, I got the same error:

Bundling/transpiling failed with this error: Name must be lowercase, can contain digits, dots, dashes, "@" or spaces

I just updated to the newest version as well.

Thanks!

MrMooky commented 3 years ago

@bradleyDouglas No solution so far on my end. Had to go the "old-school" way for now.