I am currently writing a plugin for obsidian.md that renders math functions inside a code block. I used webpack for bundling node libraries like yaml and function-plot. In the config, I added 'obsidian' as an external. The plugin builds with a warning about the bundle size but that doesn't matter since it's local anyways. When I add the plugin, it always says ''obsidian' not defined'. I guess it's looking for obsidian in the global context and can't find it? Here's the repo: https://github.com/leonhma/obsidian-functionplot Do you know how to configure webpack properly? There's probably some really easy fix but I'm also new to typescript, webpack and developing plugins for obsidian..
Obsidian.md Plugins: ''obsidian' not defined'
655 Views Asked by leonhma At
1
There are 1 best solutions below
Related Questions in JAVASCRIPT
- Angular Show All When No Filter Is Supplied
- Why does a function show up as not defined
- I count the time the user takes to solve my quiz using Javascript but I want the same time displayed on another page
- Set "More" "Less" font size
- Using pagination on a table in AngularJS
- How to sort these using Javascript or Jquery Most effectively
- how to fill out the table with next values in array with one button
- State with different subviews
- Ajax jQuery firing multiple time display event for the same result
- Getting and passing MVC Model data to AngularJS controller
- Disable variable in eval
- javascript nested loops waiting for user input
- .hover() seems to overwrite .click()
- How to sort a multi-dimensional array by the second array in descending order?
- How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
Related Questions in WEBPACK
- RequireJS shim config in webpack
- Webpack Uglify plugin returns "Killed" on Ubuntu
- Log to node console or debug during webpack build
- Gulp with WebPack. Which should be building my coffee/jade etc.?
- Webpack: silence output
- Webpack: Must i specify the domain in publicPath for url() directive to work in CSS?
- webpack-dev-server & jsxhint: const '$__0' has already been declared
- Use Webpack to split out a module so that it can be loaded in a WebWorker
- oclazyLoad with webpack to support lazy loading for Angularjs is not working on minification
- How to make webpack to produce only one file and include all chunks?
- Reduce transpiled code helpers with babel and webpack
- webpack sass compliation stuck, however same works with similar other file also same problamatic sass file works with gulp-sass module
- Webpack html-loader returns full module definition
- Webpack: Create a bundle with each file in directory
- Include paths for imports in babel using webpack
Related Questions in WEBPACK-5
- Why do Webpack 5 return a non-zero error code for performance hints?
- webpack v5 devtool should match pattern
- ReactJS Webpack : ReferenceError: window is not defined
- webpack v5 SourceMapDevToolPlugin "exclude" option not working
- How to fix deprecation warning for Chunk.modulesIterable?
- A problem when I use webpack-5's libraryTarget:window
- After build via Webpack 5 app stoped working on Internet Explorer (IE11)
- Webpack 5 plugin: No code generation entry for module error
- Module Federation Shared Services
- Vue build Generating CSS file twice when using Webpack & PurgeCSS
- Webpack Behind Nginx In Subdirectory Websocket not Connecting
- Webpack doubles text on minimization
- Use a unique alias in WebPack 5
- CesiumJS Pins Created Dynamically Not Updating in Real-Time in Viewer
- Why is "dist/main.js" created only with the codes in my index.js file but not more when I use Webpack?
Related Questions in OBSIDIAN
- Enabling Cookies for Google Calendar Embedded Page in Obsidian Desktop App on Manjaro Linux
- Linking of Words/headers in Obsidian not working
- How do I make the headers the correct size in Obsidian while running Hyprland
- How do I show a list of notes in my Obsidian vault that do not include a tag name?
- Snip and annotate PDFs with bibliography for research paper
- Installed Obsidian in Ubuntu with Snap, Creates Symlinks on First Run and Fails
- Markdown-To-PDF indentation via CSS (in obsidian)
- How can I get the currently playing Song from a Browser in NodeJS?
- Obsidian.md Plugins: ''obsidian' not defined'
- Can A Google Apps Script Retroactively Set The Google Drive indexableText attribute For Uploaded Files
- How to create a gutter for obsidian codeblocks?
- How can I correctly insert a :has() and :nth-child() condition into this CSS?
- Obsidian formats code in a wierd way when in Read-Mode
- How do I remove a scrolling event handler from a specific element/class?
- Cannot access autospawn lock Debian
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Thank you @håkon-hægland for your suggestion (why didn't I think of that?). First of all, the file generated by webpack looked like
, so webpack tried to access some global object called 'obsidian'. The important part in
webpack.config.jswasAs per your suggestion, i took a look at the other repo, and they use
That fixed my problem and now obsidian is properly imported at runtime. Just posting this in case someone else has this problem, as i couldn't find an existing answer myself.
PS: For those interested, since you are most certainly developing obsidian plugins: It was also really important to set
output.libraryTargettocommonjsorcommonjs2inside the webpack config.