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

Babel modules not found #691

Closed
raimund-schluessler opened this issue Oct 26, 2019 · 11 comments · Fixed by #749
Closed

Babel modules not found #691

raimund-schluessler opened this issue Oct 26, 2019 · 11 comments · Fixed by #749
Labels
bug Something isn't working configuration Pull requests that update a config file discussion Need advices, opinions or ideas on this topic

Comments

@raimund-schluessler
Copy link
Contributor

raimund-schluessler commented Oct 26, 2019

With the update to 1.1.0 building the app fails with

ERROR` in ./node_modules/@nextcloud/vue/dist/Components/Multiselect.js
Module not found: Error: Can't resolve '@babel/runtime/helpers/asyncToGenerator' in '/builds/raimund.schluessler/Inventory/node_modules/@nextcloud/vue/dist/Components'
 @ ./node_modules/@nextcloud/vue/dist/Components/Multiselect.js 108:42-92
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/RelationModal.vue?vue&type=script&lang=js&
 @ ./src/components/RelationModal.vue?vue&type=script&lang=js&
 @ ./src/components/RelationModal.vue
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/TheItemDetails.vue?vue&type=script&lang=js&
 @ ./src/components/TheItemDetails.vue?vue&type=script&lang=js&
 @ ./src/components/TheItemDetails.vue
 @ ./src/components/TheRouter.js
 @ ./src/main.js

ERROR in ./node_modules/@nextcloud/vue/dist/Components/Multiselect.js
Module not found: Error: Can't resolve '@babel/runtime/helpers/typeof' in '/builds/raimund.schluessler/Inventory/node_modules/@nextcloud/vue/dist/Components'
 @ ./node_modules/@nextcloud/vue/dist/Components/Multiselect.js 108:8119-8159
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/RelationModal.vue?vue&type=script&lang=js&
 @ ./src/components/RelationModal.vue?vue&type=script&lang=js&
 @ ./src/components/RelationModal.vue
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/TheItemDetails.vue?vue&type=script&lang=js&
 @ ./src/components/TheItemDetails.vue?vue&type=script&lang=js&
 @ ./src/components/TheItemDetails.vue
 @ ./src/components/TheRouter.js
 @ ./src/main.js

ERROR in ./node_modules/@nextcloud/vue/dist/Components/Multiselect.js
Module not found: Error: Can't resolve '@babel/runtime/regenerator' in '/builds/raimund.schluessler/Inventory/node_modules/@nextcloud/vue/dist/Components'
 @ ./node_modules/@nextcloud/vue/dist/Components/Multiselect.js 87:41-78
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/RelationModal.vue?vue&type=script&lang=js&
 @ ./src/components/RelationModal.vue?vue&type=script&lang=js&
 @ ./src/components/RelationModal.vue
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/TheItemDetails.vue?vue&type=script&lang=js&
 @ ./src/components/TheItemDetails.vue?vue&type=script&lang=js&
 @ ./src/components/TheItemDetails.vue
 @ ./src/components/TheRouter.js
 @ ./src/main.js
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! inventory@0.0.1 build: `npm run sprites && webpack --progress --hide-modules --config webpack.prod.js`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the inventory@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

v1.0.0 built fine. Do you have any idea what might have changed?

@raimund-schluessler raimund-schluessler added the bug Something isn't working label Oct 26, 2019
@skjnldsv
Copy link
Contributor

cc @ChristophWurst

@raimund-schluessler
Copy link
Contributor Author

See nextcloud/tasks#688 for the failing build and configuration.

@ChristophWurst
Copy link
Contributor

cc @ChristophWurst

Mail builds fine 🤔

@ChristophWurst
Copy link
Contributor

You still use the old babel-core. Could that be a conflict? Do you still need/use it?

@raimund-schluessler
Copy link
Contributor Author

You still use the old babel-core. Could that be a conflict? Do you still need/use it?

The "babel-core": "^7.0.0-bridge.0", is needed because of "vue-jest": "^3.0.5",: vuejs/vue-jest#160

But now that you say it, I wonder why "babel-core": "^7.0.0-bridge.0", is not in https://github.com/nextcloud/calendar/blob/master/package.json since the Calendar app also uses vue-jest.

@ChristophWurst
Copy link
Contributor

^ @georgehrke :)

@georgehrke
Copy link
Contributor

georgehrke commented Oct 28, 2019

We use the new @babel/core packages instead of old babel-core. (pretty much ever since i branched of Vue months ago and now in master)

@raimund-schluessler
Copy link
Contributor Author

When I remove "babel-core": "^7.0.0-bridge.0", I get a lot of these errors when I run npm run test:

Failed to collect coverage from /var/www/nextcloud/apps/tasks/src/components/DeleteCompletedModal.vue
ERROR: Cannot find module 'babel-core'
STACK: Error: Cannot find module 'babel-core'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/var/www/nextcloud/apps/tasks/node_modules/vue-jest/lib/compilers/babel-compiler.js:1:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

@georgehrke The same happens for the calendar app, if you actually do some testing. E.g. this test fails with the same error:

import { shallowMount } from '@vue/test-utils'
import emptyCalendar from '../../../../src/components/EmptyCalendar.vue'

describe('components/emptyCalendar test suite', () => {

	it('should be true', () => {
		const wrapper = shallowMount(emptyCalendar)
		expect(true).toEqual(true)
	})

})

Your tests so far don't show this error, only because you don't actually test anything yet ;-)

@ChristophWurst
Copy link
Contributor

Your tests so far don't show this error, only because you don't actually test anything yet ;-)

@georgehrke nice try :)

@skjnldsv skjnldsv added configuration Pull requests that update a config file discussion Need advices, opinions or ideas on this topic labels Oct 29, 2019
@raimund-schluessler
Copy link
Contributor Author

Btw. removing "babel-core": "^7.0.0-bridge.0", does not solve the error.

@raimund-schluessler
Copy link
Contributor Author

So what is the status or plan here? How can I get this to work for Tasks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working configuration Pull requests that update a config file discussion Need advices, opinions or ideas on this topic
Projects
None yet
4 participants