errors.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. "use strict";
  2. /*
  3. Copyright 2018 Google LLC
  4. Use of this source code is governed by an MIT-style
  5. license that can be found in the LICENSE file or at
  6. https://opensource.org/licenses/MIT.
  7. */
  8. Object.defineProperty(exports, "__esModule", { value: true });
  9. exports.errors = void 0;
  10. const common_tags_1 = require("common-tags");
  11. exports.errors = {
  12. 'unable-to-get-rootdir': `Unable to get the root directory of your web app.`,
  13. 'no-extension': (0, common_tags_1.oneLine) `Unable to detect a usable extension for a file in your web
  14. app directory.`,
  15. 'invalid-file-manifest-name': (0, common_tags_1.oneLine) `The File Manifest Name must have at least one
  16. character.`,
  17. 'unable-to-get-file-manifest-name': 'Unable to get a file manifest name.',
  18. 'invalid-sw-dest': `The 'swDest' value must be a valid path.`,
  19. 'unable-to-get-sw-name': 'Unable to get a service worker file name.',
  20. 'unable-to-get-save-config': (0, common_tags_1.oneLine) `An error occurred when asking to save details
  21. in a config file.`,
  22. 'unable-to-get-file-hash': (0, common_tags_1.oneLine) `An error occurred when attempting to create a
  23. file hash.`,
  24. 'unable-to-get-file-size': (0, common_tags_1.oneLine) `An error occurred when attempting to get a file
  25. size.`,
  26. 'unable-to-glob-files': 'An error occurred when globbing for files.',
  27. 'unable-to-make-manifest-directory': (0, common_tags_1.oneLine) `Unable to make output directory for
  28. file manifest.`,
  29. 'read-manifest-template-failure': 'Unable to read template for file manifest',
  30. 'populating-manifest-tmpl-failed': (0, common_tags_1.oneLine) `An error occurred when populating the
  31. file manifest template.`,
  32. 'manifest-file-write-failure': 'Unable to write the file manifest.',
  33. 'unable-to-make-sw-directory': (0, common_tags_1.oneLine) `Unable to make the directories to output
  34. the service worker path.`,
  35. 'read-sw-template-failure': (0, common_tags_1.oneLine) `Unable to read the service worker template
  36. file.`,
  37. 'sw-write-failure': 'Unable to write the service worker file.',
  38. 'sw-write-failure-directory': (0, common_tags_1.oneLine) `Unable to write the service worker file;
  39. 'swDest' should be a full path to the file, not a path to a directory.`,
  40. 'unable-to-copy-workbox-libraries': (0, common_tags_1.oneLine) `One or more of the Workbox libraries
  41. could not be copied over to the destination directory: `,
  42. 'invalid-generate-sw-input': (0, common_tags_1.oneLine) `The input to generateSW() must be an object.`,
  43. 'invalid-glob-directory': (0, common_tags_1.oneLine) `The supplied globDirectory must be a path as a
  44. string.`,
  45. 'invalid-dont-cache-bust': (0, common_tags_1.oneLine) `The supplied 'dontCacheBustURLsMatching'
  46. parameter must be a RegExp.`,
  47. 'invalid-exclude-files': 'The excluded files should be an array of strings.',
  48. 'invalid-get-manifest-entries-input': (0, common_tags_1.oneLine) `The input to
  49. 'getFileManifestEntries()' must be an object.`,
  50. 'invalid-manifest-path': (0, common_tags_1.oneLine) `The supplied manifest path is not a string with
  51. at least one character.`,
  52. 'invalid-manifest-entries': (0, common_tags_1.oneLine) `The manifest entries must be an array of
  53. strings or JavaScript objects containing a url parameter.`,
  54. 'invalid-manifest-format': (0, common_tags_1.oneLine) `The value of the 'format' option passed to
  55. generateFileManifest() must be either 'iife' (the default) or 'es'.`,
  56. 'invalid-static-file-globs': (0, common_tags_1.oneLine) `The 'globPatterns' value must be an array
  57. of strings.`,
  58. 'invalid-templated-urls': (0, common_tags_1.oneLine) `The 'templatedURLs' value should be an object
  59. that maps URLs to either a string, or to an array of glob patterns.`,
  60. 'templated-url-matches-glob': (0, common_tags_1.oneLine) `One of the 'templatedURLs' URLs is already
  61. being tracked via 'globPatterns': `,
  62. 'invalid-glob-ignores': (0, common_tags_1.oneLine) `The 'globIgnores' parameter must be an array of
  63. glob pattern strings.`,
  64. 'manifest-entry-bad-url': (0, common_tags_1.oneLine) `The generated manifest contains an entry without
  65. a URL string. This is likely an error with workbox-build.`,
  66. 'modify-url-prefix-bad-prefixes': (0, common_tags_1.oneLine) `The 'modifyURLPrefix' parameter must be
  67. an object with string key value pairs.`,
  68. 'invalid-inject-manifest-arg': (0, common_tags_1.oneLine) `The input to 'injectManifest()' must be an
  69. object.`,
  70. 'injection-point-not-found': (0, common_tags_1.oneLine) `Unable to find a place to inject the manifest.
  71. Please ensure that your service worker file contains the following: `,
  72. 'multiple-injection-points': (0, common_tags_1.oneLine) `Please ensure that your 'swSrc' file contains
  73. only one match for the following: `,
  74. 'populating-sw-tmpl-failed': (0, common_tags_1.oneLine) `Unable to generate service worker from
  75. template.`,
  76. 'useless-glob-pattern': (0, common_tags_1.oneLine) `One of the glob patterns doesn't match any files.
  77. Please remove or fix the following: `,
  78. 'bad-template-urls-asset': (0, common_tags_1.oneLine) `There was an issue using one of the provided
  79. 'templatedURLs'.`,
  80. 'invalid-runtime-caching': (0, common_tags_1.oneLine) `The 'runtimeCaching' parameter must an an
  81. array of objects with at least a 'urlPattern' and 'handler'.`,
  82. 'static-file-globs-deprecated': (0, common_tags_1.oneLine) `'staticFileGlobs' is deprecated.
  83. Please use 'globPatterns' instead.`,
  84. 'dynamic-url-deprecated': (0, common_tags_1.oneLine) `'dynamicURLToDependencies' is deprecated.
  85. Please use 'templatedURLs' instead.`,
  86. 'urlPattern-is-required': (0, common_tags_1.oneLine) `The 'urlPattern' option is required when using
  87. 'runtimeCaching'.`,
  88. 'handler-is-required': (0, common_tags_1.oneLine) `The 'handler' option is required when using
  89. runtimeCaching.`,
  90. 'invalid-generate-file-manifest-arg': (0, common_tags_1.oneLine) `The input to generateFileManifest()
  91. must be an Object.`,
  92. 'invalid-sw-src': `The 'swSrc' file can't be read.`,
  93. 'same-src-and-dest': (0, common_tags_1.oneLine) `Unable to find a place to inject the manifest. This is
  94. likely because swSrc and swDest are configured to the same file.
  95. Please ensure that your swSrc file contains the following:`,
  96. 'only-regexp-routes-supported': (0, common_tags_1.oneLine) `Please use a regular expression object as
  97. the urlPattern parameter. (Express-style routes are not currently
  98. supported.)`,
  99. 'bad-runtime-caching-config': (0, common_tags_1.oneLine) `An unknown configuration option was used
  100. with runtimeCaching: `,
  101. 'invalid-network-timeout-seconds': (0, common_tags_1.oneLine) `When using networkTimeoutSeconds, you
  102. must set the handler to 'NetworkFirst'.`,
  103. 'no-module-name': (0, common_tags_1.oneLine) `You must provide a moduleName parameter when calling
  104. getModuleURL().`,
  105. 'bad-manifest-transforms-return-value': (0, common_tags_1.oneLine) `The return value from a
  106. manifestTransform should be an object with 'manifest' and optionally
  107. 'warnings' properties.`,
  108. 'string-entry-warning': (0, common_tags_1.oneLine) `Some items were passed to additionalManifestEntries
  109. without revisioning info. This is generally NOT safe. Learn more at
  110. https://bit.ly/wb-precache.`,
  111. 'no-manifest-entries-or-runtime-caching': (0, common_tags_1.oneLine) `Couldn't find configuration for
  112. either precaching or runtime caching. Please ensure that the various glob
  113. options are set to match one or more files, and/or configure the
  114. runtimeCaching option.`,
  115. 'cant-find-sourcemap': (0, common_tags_1.oneLine) `The swSrc file refers to a sourcemap that can't be
  116. opened:`,
  117. 'nav-preload-runtime-caching': (0, common_tags_1.oneLine) `When using navigationPreload, you must also
  118. configure a runtimeCaching route that will use the preloaded response.`,
  119. 'cache-name-required': (0, common_tags_1.oneLine) `When using cache expiration, you must also
  120. configure a custom cacheName.`,
  121. 'manifest-transforms': (0, common_tags_1.oneLine) `When using manifestTransforms, you must provide
  122. an array of functions.`,
  123. 'invalid-handler-string': (0, common_tags_1.oneLine) `The handler name provided is not valid: `,
  124. };