logo
search
SharePoint Document Issues

How to Host a Custom JavaScript or Vue.js App in SharePoint Online

Kushani NimanthikaKushani Nimanthika Oct 22, 2026 868 views

Question details

The user wants to upload and run a custom JavaScript application (such as Vue.js or React) directly within a SharePoint Online document library.

How to Host a Custom JavaScript App in SharePoint Online
Product
SharePoint Online
Device & OS
not provided
Scenario
Uploading a custom ASPX or JavaScript file to a document library in hopes of rendering a standalone frontend application.
Observed behavior
SharePoint forces the ASPX or JS file to download to the user's local machine instead of executing and rendering the application in the browser.
Before you start

Verify whether you have Global Administrator or SharePoint Administrator privileges, as standard users cannot modify the strict custom script security settings in SharePoint Online.

Solution 1Recommended

Package the Application as a SharePoint Framework (SPFx) Web Part

This is the safest and only officially supported method by Microsoft for running modern JavaScript frameworks (like Vue.js, React, or Angular) in SharePoint Online.

SharePoint Online modern pages are not designed to run raw ASPX or JS files from document libraries due to strict security architectures. Converting your application into an SPFx web part ensures it runs natively within the SharePoint context while adhering to tenant security policies.

1
Set up the development environment

Install Node.js, Yeoman, Gulp, and the Yeoman SharePoint generator (@microsoft/sharepoint) on your local machine.

2
Create a new SPFx project

Open your command line interface, run 'yo @microsoft/sharepoint', and follow the prompts to create a new Client-side web part.

3
Migrate your existing code

Move your Vue.js or React components into the newly created SPFx project structure, ensuring the entry points match the web part's render method.

4
Bundle and deploy the solution

Run 'gulp bundle --ship' and 'gulp package-solution --ship' to generate an .sppkg file. Upload this package to your SharePoint Tenant App Catalog to make it available across your sites.

Package the Application as a SharePoint Framework (SPFx) Web Part
Free Microsoft Office alternative

Looking for a Simpler Way to Manage Documents? Try WPS Office

While managing SharePoint administrative policies and custom app deployments can be highly complex and developer-intensive, daily document management doesn't have to be. WPS Office provides a lightweight, highly compatible, and user-friendly environment for your standard document, spreadsheet, and presentation needs without requiring complex IT configurations.

Fully compatible with Microsoft Word, Excel, and PowerPoint formatsFree and lightweight with no complex admin setups or scripting requiredIntuitive interface that allows users to seamlessly edit and collaborateBuilt-in robust PDF editing and conversion tools
microsoft office alternative - wps office

Frequently Asked Questions

Why does my ASPX file download instead of opening in SharePoint?

SharePoint Online blocks custom scripts by default to prevent malicious code injection. When a document library encounters an ASPX or JS file containing scripts without admin approval, the server forces it to download as an attachment rather than rendering it in the browser.

Can I use Vue.js or React directly in a classic Content Editor Web Part?

While it was historically possible in classic SharePoint Server environments, modern SharePoint Online pages do not support the Content Editor Web Part. The officially supported route for modern sites is migrating your code into a SharePoint Framework (SPFx) web part.

How long does it take for custom script settings to take effect in SharePoint Online?

If a Global or SharePoint Administrator enables custom scripts via the SharePoint Admin Center GUI, it typically takes about 24 hours for the changes to apply across the entire tenant.

Where can I get developer help for SharePoint Framework (SPFx)?

Because custom JavaScript and SPFx development falls outside general user support, the best places to seek developer assistance are the official Microsoft Learn documentation, the Microsoft Tech Community, or SharePoint Stack Exchange.