question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

export default is missing

See original GitHub issue

Version

1.0.0-beta.31

Reproduction link

https://jsfiddle.net/q7d08jwy/

Steps to reproduce

switch any import statement of the test utils from: import * as utils from "@vue/test-utils"; to: import utils from "@vue/test-utils";

What is expected?

testUtils should contain all the exports like it did in v1.0.0-beta-28 so you can do import testUtils from “@vue/test-utils”; testUtils.mount(…)

What is actually happening?

testUtils is undefined


I think we shouldn’t restrict options.

The changes where introduced in this commit: https://github.com/vuejs/vue-test-utils/commit/d45e248ea9d0b9665ba19a020483db493219b481

This is definetly a breaking change and should be documented in the release notes if intended!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lmiller1990commented, Jan 25, 2020

Ok, I think the above points are compelling enough to not add this. Sorry for the inconvenience @adrianjost - we should have documented this more clearly in our release notes.

Since there is a pretty simple fix available, I’m going to close this issue.

0reactions
adrianjostcommented, Jan 25, 2020

I totally understand that this software is still in beta and changes may happen. I was just wondering because I had found this issue: https://github.com/vuejs/vue-test-utils/issues/873 where it was implicitly implemented and it was in the docs a couple of versions earlier. I am 100% fine leaving it as is now because of the easy fix.


FYI: I tried implementing export default again and this simple (but ugly duplicate) code seem to work fine (yarn test:unit:only:dev and yarn build are working without any problem). I have had some problems with flow (which I never used before) when putting the object into a variable thats why the code is that ugly. But it does work.

I did the adjustments in this file

export default {
  createLocalVue,
  createWrapper,
  config,
  enableAutoDestroy,
  mount,
  resetAutoDestroyState,
  shallow,
  shallowMount,
  RouterLinkStub,
  Wrapper,
  WrapperArray
};
export {
  createLocalVue,
  createWrapper,
  config,
  enableAutoDestroy,
  mount,
  resetAutoDestroyState,
  shallow,
  shallowMount,
  RouterLinkStub,
  Wrapper,
  WrapperArray,
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Export default was not found - Stack Overflow
That's because you didn't export the thing you wanted to export in your module, or you're using a different name for it. When...
Read more >
Javascript - Export default was not found - Laracasts
Hi, using this line import translateDate from '@/utils/date-translation' you basically tell JS to import the default exported object from the file and use...
Read more >
Solved - Export 'x' (imported as 'y') was not found in the ...
The "import not found" error occurs when we perform a named and/or a default import from a file that doesn't have a named...
Read more >
Error: CSF: missing default export #16598 - GitHub
Writing stories in separate files and re-exporting them from a single file yields the error: Error: CSF: missing default export To Reproduce ...
Read more >
WARN export 'default' (imported as 'content') was not found
WARN export 'default' (imported as 'content') was not found ... So basically it is related to mini-css-extract-plugin, we have used it to extract...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found