tamani-coding / angular-azure-blob-storage-sas-example Goto Github PK
View Code? Open in Web Editor NEWangular-azure-blob-storage
angular-azure-blob-storage
Hi ,
Could you please help me to fix this issue. I am trying to upload the images to blob conatianer . But when I trying the same I am getting the CORS policy issue.
localhost/:1 Access to XMLHttpRequest at '' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Thanks in Advance :) take care.
const { BlobServiceClient, AnonymousCredential, newPipeline } =require( '@azure/storage-blob');
if we use this method for import
ng serve
โ Browser application bundle generation complete.
Initial Chunk Files | Names | Size
vendor.js | vendor | 423.91 kB
styles.css | styles | 293.69 kB
scripts.js | scripts | 232.10 kB
runtime.js | runtime | 6.15 kB
main.js | main | 2.00 kB
polyfills.js | polyfills | 678 bytes
| Initial Total | 958.52 kB
Build at: 2024-03-30T06:32:37.265Z - Hash: 16ac084206046eac09ef - Time: 46644ms
Error: src/app/admin/training-files/training-files.component.ts:7:64 - error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try npm i @types/node and then add node to the types field in your tsconfig.
7 const { BlobServiceClient, AnonymousCredential, newPipeline } =require( '@azure/storage-blob');
.....................................
if
import { BlobServiceClient, AnonymousCredential, newPipeline } from '@azure/storage-blob';
ng serve
โ Browser application bundle generation complete.
Initial Chunk Files | Names | Size
vendor.js | vendor | 423.91 kB
styles.css | styles | 293.69 kB
scripts.js | scripts | 232.10 kB
runtime.js | runtime | 6.15 kB
main.js | main | 2.00 kB
polyfills.js | polyfills | 678 bytes
| Initial Total | 958.52 kB
Build at: 2024-03-30T06:40:27.512Z - Hash: 88f6f8fa48d1fbcdee18 - Time: 49288ms
Error: node_modules/@azure/logger/dist/commonjs/index.d.ts:1:15 - error TS1005: ',' expected.
1 import { type Debugger } from "./debug.js";
node_modules/@azure/core-util/dist/commonjs/index.d.ts:1:22 - error TS1005: ',' expected.
1 export { delay, type DelayOptions } from "./delay.js";
node_modules/@azure/core-util/dist/commonjs/index.d.ts:2:15 - error TS1005: ',' expected.
2 export { type AbortOptions, cancelablePromiseRace, type AbortablePromiseBuilder, } from "./aborterUtils.js";
node_modules/@azure/core-util/dist/commonjs/index.d.ts:2:57 - error TS1005: ',' expected.
2 export { type AbortOptions, cancelablePromiseRace, type AbortablePromiseBuilder, } from "./aborterUtils.js";
node_modules/@azure/core-util/dist/commonjs/index.d.ts:3:39 - error TS1005: ',' expected.
3 export { createAbortablePromise, type CreateAbortablePromiseOptions, } from "./createAbortablePromise.js";
node_modules/@azure/core-util/dist/commonjs/index.d.ts:5:25 - error TS1005: ',' expected.
5 export { isObject, type UnknownObject } from "./object.js";
~~~~~
node_modules/@azure/core-util/dist/commonjs/index.d.ts:11:55 - error TS1005: ',' expected.
11 export { uint8ArrayToString, stringToUint8Array, type EncodingType } from "./bytesEncoding.js";
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.