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.

Create modules from strings

See original GitHub issue

Describe the bug The examples show that we can use createSFCModule, however I’m only able to use loadModule.

To Reproduce Steps to reproduce the behavior:

  1. Add the latest vue3-sfc-loader to the <head>.
  2. Add a script tag with const { createSFCModule } = window["vue3-sfc-loader"];
  3. Try to use the function.
  4. See the error (createSFCModule is undefined): Uncaught TypeError: createSFCModule is not a function

Expected behavior createSFCModule should create a new component from a single file component source string.

Desktop (please complete the following information):

  • OS: Manjaro Linux
  • Browser: Firefox
  • Version: 83

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
FranckFreiburgercommented, Nov 28, 2020

In order to avoid new issues like “my styles do not work” I will definitively keep addStyle() mandatory but the error will be clearer. BTW, you can define addStyle with () => {}

0reactions
maximdeclercqcommented, Nov 28, 2020

I agree that the error message is not clear 😉 options.addStyle() is not optional

Ah thanks, can you correct this example or make it optional? https://github.com/FranckFreiburger/vue3-sfc-loader#using-another-template-language-pug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python String Module | DigitalOcean
Python string module contains a single utility function - capwords(s, sep=None). This function split the specified string into words using str.
Read more >
import module from string variable - python - Stack Overflow
I'm writing Python script which I hope will automate document generation from future MPL releases. I selected interested submodules/packages and ...
Read more >
module-from-string - npm
Load module from string using require or import. ... Start using module-from-string in your project by running `npm i module-from-string`.
Read more >
string Module - Real Python
In this section, you'll learn all about Python's standard library. Let's start with the string module. The string module is really helpful when...
Read more >
6. Modules — Python 3.11.1 documentation
Within a module, the module's name (as a string) is available as the value ... For instance, use your favorite text editor to...
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