wet-soccer-72485
11/29/2020, 8:51 AMCapturing modules can sometimes cause problems.
Consider using import('./src/ProductCardVueApp/index.ts') or require('./src/ProductCardVueApp/index.ts') inside function 'renderProductCardReactApp': index.ts(21,29)
module './src/ProductCardVueApp/index.ts' which indirectly referenced
'(productCardData) => __awaiter(void ...': index.ts(22,17): which captured
variable 'renderer' which indirectly referenced
function 'renderToString': build.dev.js(9156,44): which captured
variable 'templateRenderer' which indirectly referenced
function 'TemplateRenderer': build.dev.js(8872,49): which referenced
function 'createStream': build.dev.js(9090,64): which referenced
function 'TemplateStream': build.dev.js(8688,26): which referenced
function 'Transform': which referenced
function 'Duplex': which referenced
function 'Readable': which referenced
function 'ReadableState': which referenced
function 'getHighWaterMark': which captured
'NumberIsInteger', a function defined at
function 'isInteger': which could not be serialized because
it was a native code function.
Function code:
function isInteger() { [native code] }
error: Error serializing '(req, res) => __awaiter(void 0, void ...': index.ts(25,220)
'(req, res) => __awaiter(void 0, void ...': index.ts(25,220): captured
variable 'renderer' which indirectly referenced
function 'renderProductCardReactApp': index.tsx(21,29): which captured
module './src/ProductCardReactApp/index.tsx' which indirectly referenced
'(productCardData) => server_1.render ...': index.tsx(24,17): which captured
module './src/ProductCardReactApp/index.tsx' which indirectly referenced
'(_a) => { var props = __rest(_a, []) ...': index.tsx(20,30): which captured
module './src/ProductCardReactApp/ProductCard.tsx' which indirectly referenced
'({ buttons, description, percentOff, ...': ProductCard.tsx(25,22): which captured
variable 'React' which indirectly referenced
function 'createElementWithValidation': react.development.js(2182,36): which referenced
function 'validateChildKeys': react.development.js(2068,26): which referenced
function 'validateExplicitKey': react.development.js(2026,28): which referenced
function 'setCurrentlyValidatingElement$1': react.development.js(1944,40): which referenced
function 'describeUnknownElementTypeFrameInDEV': react.development.js(1828,45): which referenced
function 'describeNativeComponentFrame': react.development.js(1665,37): which captured
variable 'componentFrameCache' which indirectly referenced
function 'get': which could not be serialized because
it was a native code function.
codePathOptions: {
extraIncludePaths: [join(__dirname, '../../ProductCardReactApp')],
},
error: Error: codePathOptions.extraIncludePaths not currently supported in GCP.
prehistoric-account-60014
11/30/2020, 2:07 PMAsset
resource and point it to your built app// Upload build output to the bucket as an alternative to
// > gsutil cp -z build/* {bucket}
globby.sync('**/*', { cwd: '../build' }).map(file => {
const contentType = (x => (typeof x === 'string' ? x : undefined))(mime.contentType(file))
const contentEncoding = contentType && compressible(contentType) ? 'gzip' : undefined
const cacheControl =
file === 'index.html'
? 'no-store'
: file === 'service-worker.js'
? 'no-cache'
: file.startsWith('static/')
? 'public, max-age=2592000, immutable'
: undefined
return new BucketObject(file, {
name: file,
bucket: bucket.name,
source:
contentType && compressible(contentType)
? new GzipFileAsset(`../build/${file}`)
: new FileAsset(`../build/${file}`),
contentType,
contentEncoding,
cacheControl,
})
})
import util from 'util'
import stream from 'stream'
import { join } from 'path'
import { tmpdir } from 'os'
import { createGzip } from 'zlib'
import { createReadStream, createWriteStream } from 'fs'
import { FileAsset } from '@pulumi/pulumi/asset'
const pipeline = util.promisify(stream.pipeline)
export default class GzipFileAsset extends FileAsset {
constructor(path: string) {
const tempFile = `${[...Array(30)].map(() => Math.random().toString(36)[2]).join('')}.gz`
const target = join(tmpdir(), tempFile)
super(
pipeline(createReadStream(path), createGzip(), createWriteStream(target)).then(() => target),
)
}
}
wet-soccer-72485
11/30/2020, 9:59 PMprehistoric-account-60014
11/30/2020, 10:00 PMconst object = new gcp.storage.BucketObject('table-exports-function-source', {
bucket: sourceBucket.name,
source: new pulumi.asset.AssetArchive({
lib: new pulumi.asset.FileArchive('./lib'),
'.env': new pulumi.asset.FileAsset('./.env'),
'package.json': new pulumi.asset.FileAsset('./package.json'),
'yarn.lock': new pulumi.asset.FileAsset('./yarn.lock'),
}),
})
gsutil cp -z
utilitywet-soccer-72485
12/02/2020, 9:12 PM